瀏覽代碼

Cleans up types & renames Usage to RecentUsage

main
Eric Amodio 2 年之前
父節點
當前提交
3805b17593
共有 2 個檔案被更改,包括 8 行新增21 行删除
  1. +2
    -2
      src/commands/gitCommands.utils.ts
  2. +6
    -19
      src/storage.ts

+ 2
- 2
src/commands/gitCommands.utils.ts 查看文件

@ -3,7 +3,7 @@ import { configuration } from '../configuration';
import { ContextKeys } from '../constants';
import type { Container } from '../container';
import { getContext } from '../context';
import type { Usage } from '../storage';
import type { RecentUsage } from '../storage';
import { BranchGitCommand } from './git/branch';
import { CherryPickGitCommand } from './git/cherry-pick';
import { CoAuthorsGitCommand } from './git/coauthors';
@ -140,7 +140,7 @@ export class PickCommandStep implements QuickPickStep {
private async updateCommandUsage(id: string, timestamp: number) {
let usage = this.container.storage.getWorkspace(`gitComandPalette:usage`);
if (usage === undefined) {
usage = Object.create(null) as Usage;
usage = Object.create(null) as RecentUsage;
}
usage[id] = timestamp;

+ 6
- 19
src/storage.ts 查看文件

@ -144,17 +144,13 @@ export interface WorkspaceStorage {
branch: {
comparisons?: StoredBranchComparisons;
};
connected: {
[key: string]: boolean;
};
connected: Record<string, boolean>;
gitComandPalette: {
usage?: Usage;
usage?: RecentUsage;
};
gitPath?: string;
graph: {
columns?: {
[key: string]: GraphColumnConfig;
};
columns?: Record<string, GraphColumnConfig>;
preview?: boolean;
};
remote: {
@ -234,18 +230,9 @@ export interface StoredPinnedSearch {
}
export type StoredPinnedItem = StoredPinnedComparison | StoredPinnedSearch;
export interface StoredPinnedItems {
[id: string]: StoredPinnedItem;
}
export interface StoredStarred {
[id: string]: boolean;
}
export interface Usage {
[id: string]: number;
}
export type StoredPinnedItems = Record<string, StoredPinnedItem>;
export type StoredStarred = Record<string, boolean>;
export type RecentUsage = Record<string, number>;
interface DeprecatedPinnedComparison {
path: string;

Loading…
取消
儲存