Skip to content

Commit 8bfe25e

Browse files
committed
Feedback from Copilot
1 parent 19ff487 commit 8bfe25e

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/desktop/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ export const activate = async (context: vscode.ExtensionContext): Promise<void>
9292
await clearAllViewState();
9393
await Promise.all([
9494
cpuStates.resetViewState(),
95-
componentViewer.resetViewState(),
96-
corePeripherals.resetViewState(),
95+
componentViewer.resetRuntimeViewState(),
96+
corePeripherals.resetRuntimeViewState(),
9797
liveWatchTreeDataProvider.resetViewState(),
9898
]);
9999
})

src/views/component-viewer/component-viewer-base.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,10 @@ export class ComponentViewerBase {
709709

710710
public async resetViewState(): Promise<void> {
711711
await clearComponentViewerState(this._viewId);
712+
this.resetRuntimeViewState();
713+
}
714+
715+
public resetRuntimeViewState(): void {
712716
// Reset in-memory state to defaults.
713717
this._refreshTimerEnabled = true;
714718
vscode.commands.executeCommand('setContext', `${this._viewId}.periodicUpdateEnabled`, true);

src/webviews/tree-table/src/TreeTable.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ export function TreeTable({ vscodeApi }: TreeTableProps): React.ReactElement {
207207
}, [rows]);
208208

209209
const handleTableContextMenu = useCallback((e: React.MouseEvent<HTMLElement>) => {
210-
applyRowContext(e.target as HTMLElement);
210+
if (!(e.target instanceof HTMLElement)) {
211+
return;
212+
}
213+
applyRowContext(e.target);
211214
}, [applyRowContext]);
212215

213216
const handleTooltipEnter = useCallback((content: string, e: React.MouseEvent) => {

0 commit comments

Comments
 (0)