Skip to content

Commit

Permalink
Remove async from instantiating LogTabViewModel
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
  • Loading branch information
aleksfront committed Feb 17, 2023
1 parent 902bcd7 commit 96ce8bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface InstantiateArgs {
const logsViewModelInjectable = getInjectable({
id: "logs-view-model",

instantiate: async (di, tabId: TabId) => new LogTabViewModel(tabId, {
instantiate: (di, tabId) => new LogTabViewModel(tabId, {
getLogs: di.inject(getLogsInjectable),
getLogsWithoutTimestamps: di.inject(getLogsWithoutTimestampsInjectable),
getTimestampSplitLogs: di.inject(getTimestampSplitLogsInjectable),
Expand Down
7 changes: 2 additions & 5 deletions packages/core/src/renderer/components/dock/logs/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ 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;
Expand Down Expand Up @@ -100,11 +99,9 @@ const NonInjectedLogsDockTab = observer(({


export const LogsDockTab = withInjectables<Dependencies, LogsDockTabProps>(NonInjectedLogsDockTab, {
getPlaceholder: () => <Spinner center data-testid="pod-logs-tab-content-spinner" />,

getProps: async (di, props) => ({
getProps: (di, props) => ({
...props,
model: await di.inject(logsViewModelInjectable, props.tab.id),
model: di.inject(logsViewModelInjectable, props.tab.id),
subscribeStores: di.inject(subscribeStoresInjectable),
podStore: di.inject(podStoreInjectable),
}),
Expand Down

0 comments on commit 96ce8bb

Please sign in to comment.