From c1161b95edd1bf63be68daee3598c33456b8d4ae Mon Sep 17 00:00:00 2001 From: Elio Struyf Date: Thu, 24 Feb 2022 17:12:42 +0100 Subject: [PATCH] #268 - Fix for panel not showing up after renaming --- CHANGELOG.md | 1 + src/explorerView/ExplorerView.ts | 2 +- src/panelWebView/hooks/useMessages.tsx | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf7241f4..5cc165d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - [#247](https://github.com/estruyf/vscode-front-matter/issues/247): Fix the front matter highlighting in markdown documents - [#261](https://github.com/estruyf/vscode-front-matter/issues/261): Fix to allow that tag and category fields can be renamed - [#264](https://github.com/estruyf/vscode-front-matter/issues/264): Fix for Windows paths on content folder registration +- [#268](https://github.com/estruyf/vscode-front-matter/issues/268): Fix for panel which only shows loading indicator ## [6.0.0] - 2022-01-25 - [Release Notes](https://beta.frontmatter.codes/updates/v6.0.0) diff --git a/src/explorerView/ExplorerView.ts b/src/explorerView/ExplorerView.ts index 7d5a97b3..95fb9e00 100644 --- a/src/explorerView/ExplorerView.ts +++ b/src/explorerView/ExplorerView.ts @@ -85,7 +85,7 @@ export class ExplorerView implements WebviewViewProvider, Disposable { webviewView.onDidChangeVisibility(() => { if (this.visible) { Telemetry.send(TelemetryEvent.openExplorerView); - // this.getFileData(); + DataListener.getFileData(); } }); diff --git a/src/panelWebView/hooks/useMessages.tsx b/src/panelWebView/hooks/useMessages.tsx index fd53af91..ccf96d9f 100644 --- a/src/panelWebView/hooks/useMessages.tsx +++ b/src/panelWebView/hooks/useMessages.tsx @@ -48,8 +48,14 @@ export default function useMessages() { useEffect(() => { setLoading(true); + + // Show what you got after 5 seconds + window.setTimeout(() => { + setLoading(false); + }, 5000); + vscode.postMessage({ command: CommandToCode.getData }); - }, ['']); + }, []); return { metadata,