Skip to content

Commit

Permalink
fix: another tweak to try to address ink loading bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
starpit committed Apr 19, 2023
1 parent b5d59ed commit c55e2b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import { SupportedGrid, isSupportedGrid } from "./grids.js"
import type HistoryConfig from "./history.js"
import type { GridSpec } from "../../../components/Job/types.js"

import render from "../../../components/Job/index.js"

/** @return grid model for the given `kind` for `jobId` in `profile` */
async function gridFor(
kind: SupportedGrid,
Expand Down Expand Up @@ -116,8 +118,6 @@ export default async function dashboard(args: Arguments<Options>) {
if (grids === null || (Array.isArray(grids) && grids.length === 0)) {
throw new Error(usage("top job"))
} else {
const [{ default: render }] = await Promise.all([import("../../../components/Job/index.js")])

if (process.env.ALT !== "false" && !debug.enabled) {
enterAltBufferMode()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { enterAltBufferMode } from "../term.js"
import { getCurrentContext, getCurrentCluster, getCurrentNamespace, changeContext } from "../../kubernetes.js"

import initWatcher from "./watcher.js"
import render from "../../../components/Top/index.js"

export async function getNamespaceFromArgsOrCurrent(args: Arguments<TopOptions>) {
return /*args.parsedOptions.A ? "All Namespaces" :*/ args.parsedOptions.n || (await getCurrentNamespace())
Expand All @@ -45,9 +46,6 @@ export default async function jobsController(args: Arguments<TopOptions>) {
debug("cluster", cluster)
debug("namespace", ns || "using namespace from user current context")

debug("loading UI dependencies")
const [{ default: render }] = await Promise.all([import("../../../components/Top/index.js")])

debug("rendering")
await render({
context,
Expand Down

0 comments on commit c55e2b2

Please sign in to comment.