-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui): Notice marked read when UI closed (#346)
* refactor(read): rename read to markRead * fix(markRead): mark read when ui is closed * feat(ui): add close cause to close action * feat(ui): send close action to background * feat(ui): add cause to closed action, given from close action * feat(ui): only mark notices read if closed from button * refactor(migrations): refactor V3-V4 migration * fix(migrations): fix Migration 3->4 * test(migrations): add unit tests for migration 4 * style: fix ESLint issues
- Loading branch information
1 parent
5fa9952
commit c2cc908
Showing
46 changed files
with
568 additions
and
297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { PersistedState } from 'redux-persist/es/types'; | ||
import * as R from 'ramda'; | ||
import { StateV1orV2 } from './StateV1'; | ||
import { StateV0V1orV2 } from './StateV0'; | ||
|
||
export const migration1 = (persistedState: PersistedState): StateV1orV2 => { | ||
const previousState: StateV0V1orV2 = persistedState as StateV0V1orV2; | ||
|
||
return R.compose( | ||
R.compose( | ||
R.assocPath( | ||
['prefs', 'websites'], | ||
previousState && previousState.prefs | ||
? previousState.prefs.websites | ||
: previousState.websites || [] | ||
), | ||
R.assocPath( | ||
['prefs', 'criteria'], | ||
previousState && previousState.prefs | ||
? previousState.prefs.criteria | ||
: previousState.criteria || [] | ||
), | ||
R.assocPath( | ||
['prefs', 'editors'], | ||
previousState && previousState.prefs | ||
? previousState.prefs.editors | ||
: previousState.editors || [] | ||
), | ||
R.assocPath( | ||
['prefs', 'dismissedRecos'], | ||
previousState && previousState.prefs | ||
? previousState.prefs.dismissedRecos | ||
: previousState.dismissedRecos || [] | ||
), | ||
R.assocPath( | ||
['prefs', 'approvedRecos'], | ||
previousState && previousState.prefs | ||
? previousState.prefs.approvedRecos | ||
: previousState.approvedRecos || [] | ||
), | ||
R.assocPath( | ||
['prefs', 'onInstalledDetails'], | ||
previousState && previousState.prefs | ||
? previousState.prefs.onInstalledDetails | ||
: previousState.onInstalledDetails || [] | ||
) | ||
), | ||
R.compose( | ||
R.dissoc('websites'), | ||
R.dissoc('criteria'), | ||
R.dissoc('editors'), | ||
R.dissoc('dismissedRecos'), | ||
R.dissoc('approvedRecos'), | ||
R.dissoc('onInstalledDetails') | ||
) | ||
)(previousState) as StateV1orV2; | ||
}; |
Oops, something went wrong.