Skip to content

Commit

Permalink
Eric/preferences (#1873)
Browse files Browse the repository at this point in the history
* Add initial preferences query, couple mutations

* Remove unused

* Clean up labels, migrate getModerationOpts

* Add birth date handling

* Migrate feed prefs

* Migrate thread view prefs

* Migrate homeFeed to use existing key name

* Fix up saved feeds in response, no impl yet

* Migrate saved feeds to new hooks

* Clean up more of preferences

* Fix PreferencesThreads load state

* Fix modal dismissal

* Small spacing fix

---------

Co-authored-by: Paul Frazee <[email protected]>
  • Loading branch information
estrattonbailey and pfrazee authored Nov 12, 2023
1 parent c8c308e commit 05b728f
Show file tree
Hide file tree
Showing 22 changed files with 1,337 additions and 912 deletions.
89 changes: 0 additions & 89 deletions src/lib/labeling/const.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/lib/labeling/types.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/state/modals/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
const closeModal = React.useCallback(() => {
let totalActiveModals = 0
setActiveModals(activeModals => {
activeModals.pop()
activeModals = activeModals.slice(0, -1)
totalActiveModals = activeModals.length
return activeModals
})
Expand Down
2 changes: 0 additions & 2 deletions src/state/models/root-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export class RootStoreModel {
this.agent = agent
applyDebugHeader(this.agent)
this.me.clear()
await this.preferences.sync()
await this.me.load()
if (!hadSession) {
await resetNavigation()
Expand Down Expand Up @@ -137,7 +136,6 @@ export class RootStoreModel {
}
try {
await this.me.updateIfNeeded()
await this.preferences.sync()
} catch (e: any) {
logger.error('Failed to fetch latest state', {error: e})
}
Expand Down
1 change: 0 additions & 1 deletion src/state/models/ui/create-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export class CreateAccountModel {
password: this.password,
inviteCode: this.inviteCode.trim(),
})
/* dont await */ this.rootStore.preferences.setBirthDate(this.birthDate)
track('Create Account')
} catch (e: any) {
onboardingDispatch({type: 'skip'}) // undo starting the onboard
Expand Down
Loading

0 comments on commit 05b728f

Please sign in to comment.