diff --git a/src/views/nodes/viewNode.ts b/src/views/nodes/viewNode.ts index 83a112e..5c5e856 100644 --- a/src/views/nodes/viewNode.ts +++ b/src/views/nodes/viewNode.ts @@ -223,10 +223,8 @@ export interface PageableViewNode { loadMore(limit?: number | { until?: string | undefined }, context?: Record): Promise; } -export namespace PageableViewNode { - export function is(node: ViewNode): node is ViewNode & PageableViewNode { - return isA(node, 'loadMore'); - } +export function isPageableViewNode(node: ViewNode): node is ViewNode & PageableViewNode { + return isA(node, 'loadMore'); } export abstract class SubscribeableViewNode extends ViewNode { diff --git a/src/views/viewBase.ts b/src/views/viewBase.ts index 5a5003a..35073df 100644 --- a/src/views/viewBase.ts +++ b/src/views/viewBase.ts @@ -39,8 +39,8 @@ import type { CommitsView } from './commitsView'; import type { ContributorsView } from './contributorsView'; import type { FileHistoryView } from './fileHistoryView'; import type { LineHistoryView } from './lineHistoryView'; -import type { ViewNode } from './nodes/viewNode'; -import { PageableViewNode } from './nodes/viewNode'; +import type { PageableViewNode, ViewNode } from './nodes/viewNode'; +import { isPageableViewNode } from './nodes/viewNode'; import type { RemotesView } from './remotesView'; import type { RepositoriesView } from './repositoriesView'; import type { SearchAndCompareView } from './searchAndCompareView'; @@ -449,11 +449,11 @@ export abstract class ViewBase< children = await node.getChildren(); if (children.length === 0) continue; - while (node != null && !PageableViewNode.is(node)) { + while (node != null && !isPageableViewNode(node)) { node = await node.getSplattedChild?.(); } - if (node != null && PageableViewNode.is(node)) { + if (node != null && isPageableViewNode(node)) { let child = children.find(predicate); if (child != null) return child; diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index 03016f1..5fa86f5 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -62,7 +62,7 @@ import { canEditNode, canViewDismissNode, getNodeRepoPath, - PageableViewNode, + isPageableViewNode, RepositoryFolderNode, ViewNode, ViewRefFileNode, @@ -151,7 +151,7 @@ export class ViewCommands { registerViewCommand( 'gitlens.views.refreshNode', (n: ViewNode, reset?: boolean) => { - if (reset == null && PageableViewNode.is(n)) { + if (reset == null && isPageableViewNode(n)) { n.limit = undefined; n.view.resetNodeLastKnownLimit(n); }