chore(desktop): simplify code (#1146)

This commit is contained in:
Himself65 authored and GitHub committed 2023-02-21 13:15:40 +08:00
1 parent ed4d1e8bcd
commit edd8f347bc
13 files changed
+30 -191

No files matched your search

+3 -1
View File
@@ -1,7 +1,9 @@
declare global {
// eslint-disable-next-line no-var
var __editoVersion: unknown;
interface Window {
CLIENT_APP?: boolean;
__editoVersion?: string;
}
}
+13 -6
View File
@@ -43,11 +43,18 @@ const printBuildInfo = () => {
};
function setWindowEditorVersion() {
// when it is not SSR
if (typeof window !== 'undefined') {
window.__editoVersion = publicRuntimeConfig.EDITOR_VERSION;
}
globalThis.__editoVersion = publicRuntimeConfig.EDITOR_VERSION;
}
printBuildInfo();
setWindowEditorVersion();
declare global {
// eslint-disable-next-line no-var
var __affineSetupEnv: boolean | undefined;
}
if (!globalThis.__affineSetupEnv) {
printBuildInfo();
setWindowEditorVersion();
globalThis.__affineSetupEnv = true;
}
export {};