Skip to content

Commit

Permalink
Fixing race condition in getting initial state (#17974)
Browse files Browse the repository at this point in the history
  • Loading branch information
aasimkhan30 authored Aug 8, 2024
1 parent e53567b commit f77a0aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/reactviews/common/vscodeWebViewProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ export function VscodeWebViewProvider<State, Reducers>({ children }: VscodeWebVi
}
}

async function getState() {
const state = await extensionRpc.call('getState');
setState(state as State);
}

getTheme();
getState();
});

extensionRpc.subscribe('onDidChangeTheme', (params) => {
Expand Down

0 comments on commit f77a0aa

Please sign in to comment.