Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Commit

Permalink
Fix formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmeuli committed Jan 2, 2020
1 parent 3fe89c5 commit f411433
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 48 deletions.
2 changes: 0 additions & 2 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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.
5 changes: 1 addition & 4 deletions src/renderer/components/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
5 changes: 1 addition & 4 deletions src/renderer/components/views/overlays/OverlayContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Original file line number Diff line number Diff line change
Expand Up @@ -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);
18 changes: 8 additions & 10 deletions src/renderer/files/diary/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
22 changes: 10 additions & 12 deletions src/renderer/files/import/buildEntries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit f411433

Please sign in to comment.