Skip to content

Commit b68dfe9

Browse files
committed
Fix error commit of refresh history function
1 parent 605795a commit b68dfe9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/commands/treeView.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import * as apiClient from '@hackmd/api';
44
import { HackMDTreeViewProvider } from './../tree/index';
55
import { NoteTreeNode } from './../tree/nodes';
66
import { MdTextDocumentContentProvider } from './../mdTextDocument';
7+
import { refreshHistoryList } from './../utils';
78
const API = new apiClient.default();
89

910
export async function registerTreeViewCommands(context: vscode.ExtensionContext, store: Store) {
1011
const hackMDTreeViewProvider = new HackMDTreeViewProvider(store);
1112
context.subscriptions.push(vscode.window.registerTreeDataProvider('mdTreeItems', hackMDTreeViewProvider));
12-
context.subscriptions.push(vscode.commands.registerCommand('treeView.refreshList', () => hackMDTreeViewProvider.refresh()));
13+
context.subscriptions.push(vscode.commands.registerCommand('treeView.refreshList', async () => await refreshHistoryList()));
1314

1415
context.subscriptions.push(vscode.commands.registerCommand('clickTreeItem', async (label, noteId) => {
1516
if (label && noteId) {

src/commands/user.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export async function registerUserCommands(context: vscode.ExtensionContext, sto
4242
context.globalState.update('password', password);
4343

4444
await login(context);
45-
await refreshHistoryList(context);
45+
await refreshHistoryList();
4646
}));
4747

4848
context.subscriptions.push(vscode.commands.registerCommand('HackMD.logout', async () => {
@@ -53,6 +53,6 @@ export async function registerUserCommands(context: vscode.ExtensionContext, sto
5353
await API.logout();
5454
store.isLogin = false;
5555
vscode.window.showInformationMessage('Successfully logged out.');
56-
await refreshHistoryList(context);
56+
await refreshHistoryList();
5757
}));
5858
}

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { store } from './store';
33
import * as apiClient from '@hackmd/api';
44

55
const API = new apiClient.default();
6-
export const refreshHistoryList = async (context) => {
6+
export const refreshHistoryList = async () => {
77
if (await checkLogin()) {
88
store.history = (await API.getHistory()).history.reverse();
99
} else {

0 commit comments

Comments
 (0)