diff --git a/src/extension.ts b/src/extension.ts index e819121..ef35502 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -195,7 +195,13 @@ export async function activate(context: vscode.ExtensionContext) { context.subscriptions.push(vscode.commands.registerCommand('ptt.refresh-article', () => { ptt.resetSearchCondition(); - pttProvider.refresh(); + const boards = store.getBoardNames(); + boards.forEach(async (boardname: string) => { + store.release(boardname); + const articles = await ptt.getArticles(boardname); + store.add(boardname, articles); + pttProvider.refresh(); + }); })); context.subscriptions.push(vscode.commands.registerCommand('ptt.load-more-article', async (boardname: string) => { diff --git a/src/store.ts b/src/store.ts index 810b33d..54125ef 100644 --- a/src/store.ts +++ b/src/store.ts @@ -48,6 +48,10 @@ class ArticleStore { return this.asList(boardname).length === 0; } + getBoardNames () { + return Object.keys(this.articleStore); + } + } export default new ArticleStore();