mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(core): runtime control of telemetry (#10663)
This commit is contained in:
@@ -1,15 +1,5 @@
|
||||
import { createStore } from 'jotai';
|
||||
import { getDefaultStore } from 'jotai';
|
||||
|
||||
// global store
|
||||
let rootStore = createStore();
|
||||
|
||||
export function getCurrentStore(): ReturnType<typeof createStore> {
|
||||
return rootStore;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal do not use this function unless you know what you are doing
|
||||
*/
|
||||
export function _setCurrentStore(store: ReturnType<typeof createStore>) {
|
||||
rootStore = store;
|
||||
export function getCurrentStore() {
|
||||
return getDefaultStore();
|
||||
}
|
||||
|
||||
@@ -22,15 +22,23 @@ export const windowFrameStyleOptions: AppSetting['windowFrameStyle'][] = [
|
||||
'NativeTitleBar',
|
||||
];
|
||||
|
||||
const appSettingBaseAtom = atomWithStorage<AppSetting>('affine-settings', {
|
||||
clientBorder: BUILD_CONFIG.isElectron && !environment.isWindows,
|
||||
windowFrameStyle: 'frameless',
|
||||
enableBlurBackground: true,
|
||||
enableNoisyBackground: true,
|
||||
autoCheckUpdate: true,
|
||||
autoDownloadUpdate: true,
|
||||
enableTelemetry: true,
|
||||
});
|
||||
export const APP_SETTINGS_STORAGE_KEY = 'affine-settings';
|
||||
const appSettingBaseAtom = atomWithStorage<AppSetting>(
|
||||
APP_SETTINGS_STORAGE_KEY,
|
||||
{
|
||||
clientBorder: BUILD_CONFIG.isElectron && !environment.isWindows,
|
||||
windowFrameStyle: 'frameless',
|
||||
enableBlurBackground: true,
|
||||
enableNoisyBackground: true,
|
||||
autoCheckUpdate: true,
|
||||
autoDownloadUpdate: true,
|
||||
enableTelemetry: true,
|
||||
},
|
||||
undefined,
|
||||
{
|
||||
getOnInit: true,
|
||||
}
|
||||
);
|
||||
|
||||
type SetStateAction<Value> = Value | ((prev: Value) => Value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user