From f411433642f0f76591abadd7b3747480169feacd Mon Sep 17 00:00:00 2001 From: Samuel Meuli Date: Thu, 2 Jan 2020 17:23:06 +0100 Subject: [PATCH] Fix formatting issues --- PRIVACY.md | 2 -- src/renderer/components/AppContainer.tsx | 5 +---- .../CalendarView/CalendarContainer.tsx | 5 +---- .../CalendarView/CalendarNavContainer.tsx | 5 +---- .../ImportOverlay/ImportOverlayContainer.tsx | 5 +---- .../views/overlays/OverlayContainer.tsx | 5 +---- .../PrefOverlay/PrefOverlayContainer.tsx | 5 +---- src/renderer/files/diary/migrations.ts | 18 +++++++-------- src/renderer/files/import/buildEntries.ts | 22 +++++++++---------- 9 files changed, 24 insertions(+), 48 deletions(-) diff --git a/PRIVACY.md b/PRIVACY.md index d7e544a2..25978144 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -4,7 +4,6 @@ The Mini Diary desktop application does not collect any personal information. - ## Website The [minidiary.app](https://minidiary.app) website uses [Fathom Analytics](https://usefathom.com). @@ -13,7 +12,6 @@ Fathom Analytics is website analytics software that tracks and reports aggregate You can opt out of tracking by the Fathom software by enabling "Do Not Track" in your browser settings. - ## Contact Please do not hesitate to [contact me](https://samuelmeuli.com) for questions about this privacy policy. diff --git a/src/renderer/components/AppContainer.tsx b/src/renderer/components/AppContainer.tsx index b4f1e078..6501886c 100644 --- a/src/renderer/components/AppContainer.tsx +++ b/src/renderer/components/AppContainer.tsx @@ -19,7 +19,4 @@ const mapDispatchToProps = (dispatch: ThunkDispatchT): DispatchProps => ({ testFileExists: (): void => dispatch(testFileExists()), }); -export default connect( - mapStateToProps, - mapDispatchToProps, -)(App); +export default connect(mapStateToProps, mapDispatchToProps)(App); diff --git a/src/renderer/components/elements/Calendar/CalendarView/CalendarContainer.tsx b/src/renderer/components/elements/Calendar/CalendarView/CalendarContainer.tsx index 9ea4f655..36834772 100644 --- a/src/renderer/components/elements/Calendar/CalendarView/CalendarContainer.tsx +++ b/src/renderer/components/elements/Calendar/CalendarView/CalendarContainer.tsx @@ -16,7 +16,4 @@ const mapDispatchToProps = (dispatch: ThunkDispatchT): DispatchProps => ({ setDateSelected: (date: Date): SetDateSelectedAction => dispatch(setDateSelected(date)), }); -export default connect( - mapStateToProps, - mapDispatchToProps, -)(Calendar); +export default connect(mapStateToProps, mapDispatchToProps)(Calendar); diff --git a/src/renderer/components/elements/Calendar/CalendarView/CalendarNavContainer.tsx b/src/renderer/components/elements/Calendar/CalendarView/CalendarNavContainer.tsx index 23727576..0463730f 100644 --- a/src/renderer/components/elements/Calendar/CalendarView/CalendarNavContainer.tsx +++ b/src/renderer/components/elements/Calendar/CalendarView/CalendarNavContainer.tsx @@ -17,7 +17,4 @@ const mapDispatchToProps = (dispatch: ThunkDispatchT): DispatchProps => ({ setMonthSelectedPrevious: (): void => dispatch(setMonthSelectedPrevious()), }); -export default connect( - mapStateToProps, - mapDispatchToProps, -)(CalendarNav); +export default connect(mapStateToProps, mapDispatchToProps)(CalendarNav); diff --git a/src/renderer/components/views/overlays/ImportOverlay/ImportOverlayContainer.tsx b/src/renderer/components/views/overlays/ImportOverlay/ImportOverlayContainer.tsx index d3fb956d..1f61b1a7 100644 --- a/src/renderer/components/views/overlays/ImportOverlay/ImportOverlayContainer.tsx +++ b/src/renderer/components/views/overlays/ImportOverlay/ImportOverlayContainer.tsx @@ -12,7 +12,4 @@ const mapDispatchToProps = (dispatch: ThunkDispatchT): DispatchProps => ({ runImport: (importFilePath: string): void => dispatch(runImport(importFilePath)), }); -export default connect( - mapStateToProps, - mapDispatchToProps, -)(ImportOverlay); +export default connect(mapStateToProps, mapDispatchToProps)(ImportOverlay); diff --git a/src/renderer/components/views/overlays/OverlayContainer.tsx b/src/renderer/components/views/overlays/OverlayContainer.tsx index 37c3af80..ff52b366 100644 --- a/src/renderer/components/views/overlays/OverlayContainer.tsx +++ b/src/renderer/components/views/overlays/OverlayContainer.tsx @@ -9,7 +9,4 @@ const mapDispatchToProps = (dispatch: ThunkDispatchT): DispatchProps => ({ closeOverlay: (): SetOverlayAction => dispatch(closeOverlay()), }); -export default connect( - null, - mapDispatchToProps, -)(Overlay); +export default connect(null, mapDispatchToProps)(Overlay); diff --git a/src/renderer/components/views/overlays/PrefOverlay/PrefOverlayContainer.tsx b/src/renderer/components/views/overlays/PrefOverlay/PrefOverlayContainer.tsx index 95ba0216..db2e94a4 100644 --- a/src/renderer/components/views/overlays/PrefOverlay/PrefOverlayContainer.tsx +++ b/src/renderer/components/views/overlays/PrefOverlay/PrefOverlayContainer.tsx @@ -21,7 +21,4 @@ const mapDispatchToProps = (dispatch: ThunkDispatchT): DispatchProps => ({ updateThemePref: (themePref: ThemePref): void => dispatch(updateThemePref(themePref)), }); -export default connect( - mapStateToProps, - mapDispatchToProps, -)(PrefOverlay); +export default connect(mapStateToProps, mapDispatchToProps)(PrefOverlay); diff --git a/src/renderer/files/diary/migrations.ts b/src/renderer/files/diary/migrations.ts index 990cdbb5..7c697083 100644 --- a/src/renderer/files/diary/migrations.ts +++ b/src/renderer/files/diary/migrations.ts @@ -11,16 +11,14 @@ function migrateToMarkdown(data: MiniDiaryJson): MiniDiaryJson { }; // Replace \n with \n\n in the text part of all diary entries - Object.entries(entries).forEach( - ([indexDate, entry]): void => { - const { text } = entry; - const entryUpdated = { - ...entry, - text: text.replace(/\n/g, "\n\n"), - }; - dataMigrated.entries[indexDate] = entryUpdated; - }, - ); + Object.entries(entries).forEach(([indexDate, entry]): void => { + const { text } = entry; + const entryUpdated = { + ...entry, + text: text.replace(/\n/g, "\n\n"), + }; + dataMigrated.entries[indexDate] = entryUpdated; + }); return dataMigrated; } diff --git a/src/renderer/files/import/buildEntries.ts b/src/renderer/files/import/buildEntries.ts index 79f5f537..8df8a422 100644 --- a/src/renderer/files/import/buildEntries.ts +++ b/src/renderer/files/import/buildEntries.ts @@ -11,19 +11,17 @@ export default function buildEntries( ): Entries { const entriesToImport: Entries = {}; - parsedEntries.forEach( - (parsedEntry: ImportEntry): void => { - // Get date, title and text from entry - const { indexDate, entry: entryNew } = getContent(parsedEntry); + parsedEntries.forEach((parsedEntry: ImportEntry): void => { + // Get date, title and text from entry + const { indexDate, entry: entryNew } = getContent(parsedEntry); - if (indexDate in entriesToImport) { - const entryOld = entriesToImport[indexDate]; - entriesToImport[indexDate] = mergeEntries(entryOld, entryNew); - } else { - entriesToImport[indexDate] = entryNew; - } - }, - ); + if (indexDate in entriesToImport) { + const entryOld = entriesToImport[indexDate]; + entriesToImport[indexDate] = mergeEntries(entryOld, entryNew); + } else { + entriesToImport[indexDate] = entryNew; + } + }); return entriesToImport; }