Add extra check to markdown state

Possibly for #102733

Tries to get users out of a potential bad state where the state was being stored as a string. Only insiders users should have hit this
This commit is contained in:
Matt Bierner 2020-07-16 16:27:42 -07:00
parent cc664dbb67
commit 7099dc0708
2 changed files with 8 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -18,7 +18,13 @@ const settings = getSettings();
const vscode = acquireVsCodeApi();
const state = { ...vscode.getState(), ...getData<any>('data-state') };
const originalState = vscode.getState();
const state = {
...(typeof originalState === 'object' ? originalState : {}),
...getData<any>('data-state')
};
// Make sure to sync VS Code state here
vscode.setState(state);