@@ -19,7 +19,7 @@ export type UserPreferencesState = {
1919 cardsSettings : Record < string , CardSettingsType >
2020 firstSeenDate : number
2121 userCustomCards : SupportedCardType [ ]
22- pauseTo : number | "always"
22+ DNDDurarion : number | "always"
2323}
2424
2525type UserPreferencesStoreActions = {
@@ -35,8 +35,8 @@ type UserPreferencesStoreActions = {
3535 markOnboardingAsCompleted : ( occupation : Omit < Occupation , 'icon' > | null ) => void
3636 setUserCustomCards : ( cards : SupportedCardType [ ] ) => void
3737 updateCardOrder : ( prevIndex : number , newIndex : number ) => void
38- setPauseTo : ( value : number | "always" ) => void
39- isPauseModeActive : ( ) => boolean ;
38+ setDNDDuration : ( value : number | "always" ) => void
39+ isDNDModeActive : ( ) => boolean ;
4040}
4141
4242export const useUserPreferences = create (
@@ -59,7 +59,7 @@ export const useUserPreferences = create(
5959 { id : 3 , name : 'producthunt' , type : 'supported' } ,
6060 ] ,
6161 userCustomCards : [ ] ,
62- pauseTo : 0 ,
62+ DNDDurarion : 0 ,
6363 setSearchEngine : ( searchEngine : string ) => set ( { searchEngine : searchEngine } ) ,
6464 setListingMode : ( listingMode : ListingMode ) => set ( { listingMode : listingMode } ) ,
6565 setTheme : ( theme : Theme ) => set ( { theme : theme } ) ,
@@ -95,13 +95,13 @@ export const useUserPreferences = create(
9595
9696 return { cards : newState }
9797 } ) ,
98- setPauseTo : ( value ) => set ( { pauseTo : value } ) ,
99- isPauseModeActive : ( ) => {
100- const pauseTo = get ( ) . pauseTo
101- if ( pauseTo === "always" ) {
98+ setDNDDuration : ( value ) => set ( { DNDDurarion : value } ) ,
99+ isDNDModeActive : ( ) => {
100+ const duration = get ( ) . DNDDurarion
101+ if ( duration === "always" ) {
102102 return true ;
103103 }
104- return Boolean ( pauseTo && pauseTo - new Date ( ) . getTime ( ) > 0 )
104+ return Boolean ( duration && duration - new Date ( ) . getTime ( ) > 0 )
105105 }
106106 } ) ,
107107 {
0 commit comments