Skip to content

Commit

Permalink
fix: update userConfigsState to use getUserConfigs() as default value,
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonn committed Mar 9, 2023
1 parent 6cf084a commit a1a80eb
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/state/user-configs.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { AppUserConfigs } from '@logseq/libs/dist/LSPlugin';
import { atom, AtomEffect } from 'recoil';

export const DEFAULT_USER_CONFIGS: Partial<AppUserConfigs> = {
preferredLanguage: 'en',
preferredThemeMode: 'light',
preferredFormat: 'markdown',
preferredWorkflow: 'now',
preferredTodo: 'LATER',
preferredDateFormat: 'MMM do, yyyy',
};

const updateUserConfigsEffect: AtomEffect<Partial<AppUserConfigs>> = ({
setSelf,
trigger,
Expand All @@ -21,6 +12,6 @@ const updateUserConfigsEffect: AtomEffect<Partial<AppUserConfigs>> = ({

export const userConfigsState = atom({
key: 'userConfigs',
default: DEFAULT_USER_CONFIGS,
default: () => window.logseq.App.getUserConfigs(),
effects: [updateUserConfigsEffect],
});

0 comments on commit a1a80eb

Please sign in to comment.