mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 17:19:56 +08:00
feat(core): add toggle workspace dialog (#5312)
This commit is contained in:
@@ -3,6 +3,8 @@ import { z } from 'zod';
|
||||
const _appConfigSchema = z.object({
|
||||
/** whether to show onboarding first */
|
||||
onBoarding: z.boolean().optional().default(true),
|
||||
/** whether to show change workspace guide modal */
|
||||
dismissWorkspaceGuideModal: z.boolean().optional().default(false),
|
||||
});
|
||||
export type AppConfigSchema = z.infer<typeof _appConfigSchema>;
|
||||
export const defaultAppConfig = _appConfigSchema.parse({});
|
||||
@@ -20,7 +22,7 @@ interface StorageOptions<T> {
|
||||
/**
|
||||
* Storage for app configuration, stored in memory by default
|
||||
*/
|
||||
class Storage<T> {
|
||||
class Storage<T extends object> {
|
||||
private _cfg: T;
|
||||
private readonly _id = _inMemoryId++;
|
||||
private readonly _options;
|
||||
@@ -67,7 +69,10 @@ class Storage<T> {
|
||||
return this._cfg;
|
||||
}
|
||||
} else {
|
||||
return this.get()[key];
|
||||
const fullConfig = this.get();
|
||||
// TODO: handle key not found, set default value
|
||||
// if (!(key in fullConfig)) {}
|
||||
return fullConfig[key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user