Fix local markdown title option persistence
This commit is contained in:
@@ -638,6 +638,19 @@ export function createSidebarPageSettingsRuntime(context) {
|
||||
if (!response.ok || !payload || payload.ok !== true) {
|
||||
throw new Error(payload && payload.error && payload.error.message ? payload.error.message : 'page_settings_save_failed_' + response.status);
|
||||
}
|
||||
var script = document.getElementById('__MNOTE_PAGE_AGGREGATE__');
|
||||
if (script) {
|
||||
try {
|
||||
var aggregate = JSON.parse(script.textContent || 'null');
|
||||
if (aggregate && typeof aggregate === 'object') {
|
||||
aggregate.layout = aggregate.layout && typeof aggregate.layout === 'object' ? aggregate.layout : {};
|
||||
aggregate.layout.pageOptions = Object.assign({}, nextOptions);
|
||||
aggregate.layout_options = Object.assign({}, nextOptions);
|
||||
script.textContent = JSON.stringify(aggregate);
|
||||
script.setAttribute('data-mnote-page-options-synced-at', String(Date.now()));
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
document.documentElement.setAttribute('data-mnote-page-options-saved', 'true');
|
||||
} catch (error) {
|
||||
pageUiState.pageOptions = previous;
|
||||
|
||||
Reference in New Issue
Block a user