mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix HotbarStore.load being called twice is being buggy
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
618d0d83b5
commit
ca49e585e7
@ -100,7 +100,7 @@ export class HotbarStore extends BaseStore<HotbarStoreModel> {
|
|||||||
this._activeHotbarId = data.activeHotbarId;
|
this._activeHotbarId = data.activeHotbarId;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.activeHotbarId) {
|
if (!this._activeHotbarId) {
|
||||||
this._activeHotbarId = this.hotbars[0].id;
|
this._activeHotbarId = this.hotbars[0].id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,8 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
import hotbarStoreInjectable from "../../../../common/hotbars/store.injectable";
|
||||||
import { beforeApplicationIsLoadingInjectionToken } from "../../../../main/start-main-application/runnable-tokens/before-application-is-loading-injection-token";
|
import { onLoadOfApplicationInjectionToken } from "../../../../main/start-main-application/runnable-tokens/on-load-of-application-injection-token";
|
||||||
import initClusterStoreInjectable from "../../../cluster/store/main/init.injectable";
|
import setupSyncingOfGeneralCatalogEntitiesInjectable from "../../../../main/start-main-application/runnables/setup-syncing-of-general-catalog-entities.injectable";
|
||||||
|
|
||||||
const initHotbarStoreInjectable = getInjectable({
|
const initHotbarStoreInjectable = getInjectable({
|
||||||
id: "init-hotbar-store",
|
id: "init-hotbar-store",
|
||||||
@ -17,10 +17,10 @@ const initHotbarStoreInjectable = getInjectable({
|
|||||||
run: () => {
|
run: () => {
|
||||||
hotbarStore.load();
|
hotbarStore.load();
|
||||||
},
|
},
|
||||||
runAfter: di.inject(initClusterStoreInjectable),
|
runAfter: di.inject(setupSyncingOfGeneralCatalogEntitiesInjectable),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
injectionToken: beforeApplicationIsLoadingInjectionToken,
|
injectionToken: onLoadOfApplicationInjectionToken,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default initHotbarStoreInjectable;
|
export default initHotbarStoreInjectable;
|
||||||
|
|||||||
@ -1,27 +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 setupSyncingOfGeneralCatalogEntitiesInjectable from "./setup-syncing-of-general-catalog-entities.injectable";
|
|
||||||
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/on-load-of-application-injection-token";
|
|
||||||
import hotbarStoreInjectable from "../../../common/hotbars/store.injectable";
|
|
||||||
|
|
||||||
const setupHotbarStoreInjectable = getInjectable({
|
|
||||||
id: "setup-hotbar-store",
|
|
||||||
|
|
||||||
instantiate: (di) => ({
|
|
||||||
id: "setup-hotbar-store",
|
|
||||||
run: () => {
|
|
||||||
const hotbarStore = di.inject(hotbarStoreInjectable);
|
|
||||||
|
|
||||||
hotbarStore.load();
|
|
||||||
},
|
|
||||||
|
|
||||||
runAfter: di.inject(setupSyncingOfGeneralCatalogEntitiesInjectable),
|
|
||||||
}),
|
|
||||||
|
|
||||||
injectionToken: onLoadOfApplicationInjectionToken,
|
|
||||||
});
|
|
||||||
|
|
||||||
export default setupHotbarStoreInjectable;
|
|
||||||
Loading…
Reference in New Issue
Block a user