mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 10:36:22 +08:00
feat(electron): onboarding at first launch logic for client and web (#5183)
- Added a simple abstraction of persistent storage class.
- Different persistence solutions are provided for web and client.
- web: stored in localStorage
- client: stored in the application directory as `.json` file
- Define persistent app-config schema
- Add a new hook that can interactive with persistent-app-config reactively
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
useNavigationType,
|
||||
} from 'react-router-dom';
|
||||
|
||||
import { appConfigProxy } from '../hooks/use-app-config-storage';
|
||||
import { performanceLogger } from '../shared';
|
||||
|
||||
const performanceSetupLogger = performanceLogger.namespace('setup');
|
||||
@@ -47,5 +48,12 @@ export function setup() {
|
||||
});
|
||||
}
|
||||
|
||||
// load persistent config for electron
|
||||
// TODO: should be sync, but it's not necessary for now
|
||||
environment.isDesktop &&
|
||||
appConfigProxy
|
||||
.getSync()
|
||||
.catch(() => console.error('failed to load app config'));
|
||||
|
||||
performanceSetupLogger.info('done');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user