Procházet zdrojové kódy

Removes PageableViewNode namespace

main
Eric Amodio před 1 rokem
rodič
revize
5686c0e60c
3 změnil soubory, kde provedl 8 přidání a 10 odebrání
  1. +2
    -4
      src/views/nodes/viewNode.ts
  2. +4
    -4
      src/views/viewBase.ts
  3. +2
    -2
      src/views/viewCommands.ts

+ 2
- 4
src/views/nodes/viewNode.ts Zobrazit soubor

@ -223,10 +223,8 @@ export interface PageableViewNode {
loadMore(limit?: number | { until?: string | undefined }, context?: Record<string, unknown>): Promise<void>;
}
export namespace PageableViewNode {
export function is(node: ViewNode): node is ViewNode & PageableViewNode {
return isA<ViewNode & PageableViewNode>(node, 'loadMore');
}
export function isPageableViewNode(node: ViewNode): node is ViewNode & PageableViewNode {
return isA<ViewNode & PageableViewNode>(node, 'loadMore');
}
export abstract class SubscribeableViewNode<TView extends View = View> extends ViewNode<TView> {

+ 4
- 4
src/views/viewBase.ts Zobrazit soubor

@ -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;

+ 2
- 2
src/views/viewCommands.ts Zobrazit soubor

@ -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);
}

Načítá se…
Zrušit
Uložit