mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix init ordering during start frame
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
29a35ab71c
commit
731aec1bb8
@ -4,7 +4,6 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import fileSystemProvisionerStoreInjectable from "../../../extensions/extension-loader/file-system-provisioner-store/file-system-provisioner-store.injectable";
|
||||
import setupAppPathsInjectable from "../../../renderer/app-paths/setup-app-paths.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../../../renderer/before-frame-starts/tokens";
|
||||
|
||||
const initFileSystemProvisionerStoreInjectable = getInjectable({
|
||||
@ -16,7 +15,6 @@ const initFileSystemProvisionerStoreInjectable = getInjectable({
|
||||
|
||||
store.load();
|
||||
},
|
||||
runAfter: di.inject(setupAppPathsInjectable),
|
||||
}),
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import appPathsStateInjectable from "../../common/app-paths/app-paths-state.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/tokens";
|
||||
import { evenBeforeFrameStartsInjectionToken } from "../before-frame-starts/tokens";
|
||||
import { appPathsChannel } from "../../common/app-paths/app-paths-channel";
|
||||
import { requestFromChannelInjectionToken } from "../../common/utils/channel/request-from-channel-injection-token";
|
||||
|
||||
@ -22,7 +22,7 @@ const setupAppPathsInjectable = getInjectable({
|
||||
},
|
||||
}),
|
||||
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
injectionToken: evenBeforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
export default setupAppPathsInjectable;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { customMonacoThemeInjectionToken } from "../../components/monaco-editor";
|
||||
import addNewMonacoThemeInjectable from "../../monaco/add-new-theme.injectable";
|
||||
import { evenBeforeFrameStartsInjectionToken } from "../tokens";
|
||||
import { beforeFrameStartsInjectionToken } from "../tokens";
|
||||
|
||||
const loadMonacoThemesInjectable = getInjectable({
|
||||
id: "load-monaco-themes",
|
||||
@ -18,7 +18,7 @@ const loadMonacoThemesInjectable = getInjectable({
|
||||
customThemes.forEach(addNewMonacoTheme);
|
||||
},
|
||||
}),
|
||||
injectionToken: evenBeforeFrameStartsInjectionToken,
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
export default loadMonacoThemesInjectable;
|
||||
|
||||
@ -8,7 +8,6 @@ import navigateToAddClusterInjectable from "../../../common/front-end-routing/ro
|
||||
import isLinuxInjectable from "../../../common/vars/is-linux.injectable";
|
||||
import isWindowsInjectable from "../../../common/vars/is-windows.injectable";
|
||||
import openPathPickingDialogInjectable from "../../../features/path-picking-dialog/renderer/pick-paths.injectable";
|
||||
import setupAppPathsInjectable from "../../app-paths/setup-app-paths.injectable";
|
||||
import addSyncEntriesInjectable from "../../initializers/add-sync-entries.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../tokens";
|
||||
|
||||
@ -75,7 +74,6 @@ const setupKubernetesClusterCatalogAddMenuListenerInjectable = getInjectable({
|
||||
}
|
||||
});
|
||||
},
|
||||
runAfter: di.inject(setupAppPathsInjectable),
|
||||
}),
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
@ -8,7 +8,6 @@ import getClusterByIdInjectable from "../../../common/cluster-store/get-by-id.in
|
||||
import readFileInjectable from "../../../common/fs/read-file.injectable";
|
||||
import { loadConfigFromString } from "../../../common/kube-helpers";
|
||||
import loggerInjectable from "../../../common/logger.injectable";
|
||||
import setupAppPathsInjectable from "../../app-paths/setup-app-paths.injectable";
|
||||
import openDeleteClusterDialogInjectable from "../../components/delete-cluster-dialog/open.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../tokens";
|
||||
|
||||
@ -50,7 +49,6 @@ const setupKubernetesClusterContextMenuOpenInjectable = getInjectable({
|
||||
}
|
||||
});
|
||||
},
|
||||
runAfter: di.inject(setupAppPathsInjectable),
|
||||
}),
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
@ -9,16 +9,14 @@ import { init } from "@sentry/electron/renderer";
|
||||
|
||||
const setupSentryInjectable = getInjectable({
|
||||
id: "setup-sentry",
|
||||
instantiate: (di) => {
|
||||
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
||||
instantiate: (di) => ({
|
||||
id: "setup-sentry",
|
||||
run: () => {
|
||||
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
||||
|
||||
return {
|
||||
id: "setup-sentry",
|
||||
run: () => {
|
||||
initializeSentryReportingWith(init);
|
||||
},
|
||||
};
|
||||
},
|
||||
initializeSentryReportingWith(init);
|
||||
},
|
||||
}),
|
||||
injectionToken: evenBeforeMainFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import initializeSentryReportingWithInjectable from "../../common/error-reporting/initialize-sentry-reporting.injectable";
|
||||
import setupAppPathsInjectable from "../app-paths/setup-app-paths.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/tokens";
|
||||
import { init } from "@sentry/electron/renderer";
|
||||
|
||||
const initializeSentryReportingInjectable = getInjectable({
|
||||
id: "initialize-sentry-reporting",
|
||||
instantiate: (di) => ({
|
||||
id: "initialize-sentry-reporting",
|
||||
run: () => {
|
||||
// Have to inject this here instead of above so that its dependency on `setupAppPathsInjectable` doesn't throw
|
||||
const initializeSentryReportingWith = di.inject(initializeSentryReportingWithInjectable);
|
||||
|
||||
if (process.isMainFrame) {
|
||||
initializeSentryReportingWith(init);
|
||||
}
|
||||
},
|
||||
runAfter: di.inject(setupAppPathsInjectable),
|
||||
}),
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
export default initializeSentryReportingInjectable;
|
||||
@ -4,7 +4,6 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import userStoreInjectable from "../../common/user-store/user-store.injectable";
|
||||
import setupAppPathsInjectable from "../app-paths/setup-app-paths.injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../before-frame-starts/tokens";
|
||||
import initDefaultUpdateChannelInjectable from "../vars/default-update-channel/init.injectable";
|
||||
|
||||
@ -18,10 +17,7 @@ const initUserStoreInjectable = getInjectable({
|
||||
|
||||
return userStore.load();
|
||||
},
|
||||
runAfter: [
|
||||
di.inject(initDefaultUpdateChannelInjectable),
|
||||
di.inject(setupAppPathsInjectable),
|
||||
],
|
||||
runAfter: di.inject(initDefaultUpdateChannelInjectable),
|
||||
}),
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../../../before-frame-starts/tokens";
|
||||
import listeningOnMessageChannelsInjectable from "../../../../common/utils/channel/listening-on-message-channels.injectable";
|
||||
import setupAppPathsInjectable from "../../../app-paths/setup-app-paths.injectable";
|
||||
|
||||
const startListeningOfChannelsInjectable = getInjectable({
|
||||
id: "start-listening-of-channels-renderer",
|
||||
@ -17,7 +16,6 @@ const startListeningOfChannelsInjectable = getInjectable({
|
||||
|
||||
listeningOfChannels.start();
|
||||
},
|
||||
runAfter: di.inject(setupAppPathsInjectable),
|
||||
}),
|
||||
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user