Await logs view model to instantiate

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2023-02-16 14:52:12 +03:00
1 parent daf3fb92ea
commit 902bcd7b67
1 file changed
+5 -4
@@ -20,6 +20,7 @@ import type { SubscribeStores } from "../../../kube-watch-api/kube-watch-api";
import subscribeStoresInjectable from "../../../kube-watch-api/subscribe-stores.injectable";
import type { PodStore } from "../../+workloads-pods/store";
import podStoreInjectable from "../../+workloads-pods/store.injectable";
import { Spinner } from "../../spinner";
export interface LogsDockTabProps {
className?: string;
@@ -99,11 +100,11 @@ const NonInjectedLogsDockTab = observer(({
export const LogsDockTab = withInjectables<Dependencies, LogsDockTabProps>(NonInjectedLogsDockTab, {
getProps: (di, props) => ({
getPlaceholder: () => <Spinner center data-testid="pod-logs-tab-content-spinner" />,
getProps: async (di, props) => ({
...props,
model: di.inject(logsViewModelInjectable, {
tabId: props.tab.id,
}),
model: await di.inject(logsViewModelInjectable, props.tab.id),
subscribeStores: di.inject(subscribeStoresInjectable),
podStore: di.inject(podStoreInjectable),
}),