Fix: source editor is not closed when style is removed
This commit is contained in:
parent
2b6404cb11
commit
a4e3fba968
|
@ -2072,8 +2072,9 @@ function onRuntimeMessage(request) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'styleDeleted':
|
case 'styleDeleted':
|
||||||
if (styleId && styleId === request.id) {
|
if (styleId && styleId === request.id || editor && editor.getStyle().id === request.id) {
|
||||||
window.onbeforeunload = () => {};
|
window.onbeforeunload = () => {};
|
||||||
|
// FIXME: Scripts may not close windows that were not opened by script.
|
||||||
window.close();
|
window.close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,5 +458,12 @@ function createSourceEditor(style) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return {replaceStyle, save, toggleStyle, updateStyleMeta, isDirty: dirty.isDirty};
|
return {
|
||||||
|
replaceStyle,
|
||||||
|
save,
|
||||||
|
toggleStyle,
|
||||||
|
updateStyleMeta,
|
||||||
|
isDirty: dirty.isDirty,
|
||||||
|
getStyle: () => style
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user