feat(electron): add offline mode (#8086)

fix AF-1334

It seems `session.enableNetworkEmulation({ offline: true });` does not work - https://github.com/electron/electron/issues/21250

implemented using an in-house solution.

When turned on:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/6805735b-1006-4e51-be46-c047b0f1a82c.png)
This commit is contained in:
pengx17
2024-09-04 10:46:43 +00:00
parent 51bc40d2a8
commit 0ae5673aaa
4 changed files with 37 additions and 56 deletions

View File

@@ -96,6 +96,13 @@ export const AFFINE_FLAGS = {
configurable: isCanaryBuild,
defaultState: isCanaryBuild,
},
enable_offline_mode: {
category: 'affine',
displayName: 'Offline Mode',
description: 'Enables offline mode.',
configurable: isDesktopEnvironment,
defaultState: false,
},
} satisfies { [key in string]: FlagInfo };
export type AFFINE_FLAGS = typeof AFFINE_FLAGS;