mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Clean up markdown preview messaging (#176458)
- Add properties directly to message - Add `ImageInfo` type - Don't use state to pass around imageInfo
This commit is contained in:
@@ -22,14 +22,14 @@ let documentResource = settings.settings.source;
|
||||
|
||||
const vscode = acquireVsCodeApi();
|
||||
|
||||
const originalState = vscode.getState();
|
||||
const originalState = vscode.getState() ?? {} as any;
|
||||
|
||||
const state = {
|
||||
...(typeof originalState === 'object' ? originalState : {}),
|
||||
originalState,
|
||||
...getData<any>('data-state')
|
||||
};
|
||||
|
||||
if (originalState.resource !== state.resource) {
|
||||
if (originalState?.resource !== state.resource) {
|
||||
state.scrollProgress = undefined;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export const createPosterForVsCode = (vscode: any, settingsManager: SettingsMana
|
||||
vscode.postMessage({
|
||||
type,
|
||||
source: settingsManager.settings!.source,
|
||||
body
|
||||
...body
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user