mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix typo to waitUntilDefined
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
d18b84743d
commit
f71f9e9f8f
@ -6,7 +6,7 @@ import type { IComputedValue } from "mobx";
|
||||
import { runInAction, when } from "mobx";
|
||||
import type { Disposer } from "./disposer";
|
||||
|
||||
export async function waitUntilDefinied<T>(getter: (() => T | null | undefined) | IComputedValue<T | null | undefined>, opts?: { timeout?: number }): Promise<T> {
|
||||
export async function waitUntilDefined<T>(getter: (() => T | null | undefined) | IComputedValue<T | null | undefined>, opts?: { timeout?: number }): Promise<T> {
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
let res: T | null | undefined;
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { getRelease } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import { asyncComputed } from "@ogre-tools/injectable-react";
|
||||
import releaseInjectable from "./release.injectable";
|
||||
import { waitUntilDefinied } from "../../../utils";
|
||||
import { waitUntilDefined } from "../../../utils";
|
||||
|
||||
const releaseDetailsInjectable = getInjectable({
|
||||
id: "release-details",
|
||||
@ -15,7 +15,7 @@ const releaseDetailsInjectable = getInjectable({
|
||||
const releaseComputed = di.inject(releaseInjectable);
|
||||
|
||||
return asyncComputed(async () => {
|
||||
const release = await waitUntilDefinied(releaseComputed);
|
||||
const release = await waitUntilDefined(releaseComputed);
|
||||
|
||||
return getRelease(release.name, release.namespace);
|
||||
});},
|
||||
|
||||
@ -9,7 +9,7 @@ import type { DockTabStoreDependencies } from "../dock-tab-store/dock-tab.store"
|
||||
import { DockTabStore } from "../dock-tab-store/dock-tab.store";
|
||||
import { getChartDetails, getChartValues } from "../../../../common/k8s-api/endpoints/helm-charts.api";
|
||||
import type { HelmReleaseUpdateDetails } from "../../../../common/k8s-api/endpoints/helm-releases.api";
|
||||
import { waitUntilDefinied } from "../../../../common/utils/wait";
|
||||
import { waitUntilDefined } from "../../../../common/utils/wait";
|
||||
|
||||
export interface IChartInstallData {
|
||||
name: string;
|
||||
@ -44,7 +44,7 @@ export class InstallChartTabStore extends DockTabStore<IChartInstallData> {
|
||||
@action
|
||||
async loadData(tabId: string) {
|
||||
const promises = [];
|
||||
const data = await waitUntilDefinied(() => this.getData(tabId));
|
||||
const data = await waitUntilDefined(() => this.getData(tabId));
|
||||
|
||||
if (!this.getData(tabId)?.values) {
|
||||
promises.push(this.loadValues(tabId));
|
||||
@ -68,7 +68,7 @@ export class InstallChartTabStore extends DockTabStore<IChartInstallData> {
|
||||
|
||||
@action
|
||||
async loadValues(tabId: TabId, attempt = 0): Promise<void> {
|
||||
const data = await waitUntilDefinied(() => this.getData(tabId));
|
||||
const data = await waitUntilDefined(() => this.getData(tabId));
|
||||
const { repo, name, version } = data;
|
||||
const values = await getChartValues(repo, name, version);
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import type { IComputedValue } from "mobx";
|
||||
import { observable } from "mobx";
|
||||
import type { PodLogsQuery, Pod } from "../../../../common/k8s-api/endpoints";
|
||||
import { waitUntilDefinied } from "../../../../common/utils/wait";
|
||||
import { waitUntilDefined } from "../../../../common/utils/wait";
|
||||
import type { IntervalFn } from "../../../utils";
|
||||
import { getOrInsertWith, interval } from "../../../utils";
|
||||
import type { TabId } from "../dock/store";
|
||||
@ -117,7 +117,7 @@ export class LogStore {
|
||||
selectedContainer,
|
||||
showPrevious,
|
||||
},
|
||||
} = await waitUntilDefinied(() => {
|
||||
} = await waitUntilDefined(() => {
|
||||
const pod = computedPod.get();
|
||||
const tabData = logTabData.get();
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { when } from "mobx";
|
||||
import { waitUntilDefinied } from "../../../../common/utils/wait";
|
||||
import { waitUntilDefined } from "../../../../common/utils/wait";
|
||||
import type { TerminalApi } from "../../../api/terminal-api";
|
||||
import { TerminalChannels } from "../../../api/terminal-api";
|
||||
import { noop } from "../../../utils";
|
||||
@ -46,7 +46,7 @@ const sendCommand = ({ selectTab, createTerminalTab, getTerminalApi }: Dependenc
|
||||
tabId = createTerminalTab().id;
|
||||
}
|
||||
|
||||
const terminalApi = await waitUntilDefinied(() => (
|
||||
const terminalApi = await waitUntilDefined(() => (
|
||||
tabId
|
||||
? getTerminalApi(tabId)
|
||||
: undefined
|
||||
|
||||
Loading…
Reference in New Issue
Block a user