mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
fix(editor): white screen if CKEditor crashes a second time
This commit is contained in:
parent
d7f26fa27c
commit
d8f0709bce
@ -166,7 +166,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
// is shorter than minimumNonErrorTimePeriod, the watchdog changes
|
// is shorter than minimumNonErrorTimePeriod, the watchdog changes
|
||||||
// its state to crashedPermanently, and it stops restarting the editor.
|
// its state to crashedPermanently, and it stops restarting the editor.
|
||||||
// This prevents an infinite restart loop.
|
// This prevents an infinite restart loop.
|
||||||
crashNumberLimit: 3,
|
crashNumberLimit: 10,
|
||||||
// A minimum number of milliseconds between saving the editor data internally (defaults to 5000).
|
// A minimum number of milliseconds between saving the editor data internally (defaults to 5000).
|
||||||
// Note that for large documents, this might impact the editor performance.
|
// Note that for large documents, this might impact the editor performance.
|
||||||
saveInterval: 5000
|
saveInterval: 5000
|
||||||
@ -190,7 +190,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.watchdog.setCreator(async (elementOrData, editorConfig) => {
|
this.watchdog.setCreator(async (_, editorConfig) => {
|
||||||
logInfo("Creating new CKEditor");
|
logInfo("Creating new CKEditor");
|
||||||
|
|
||||||
const finalConfig = {
|
const finalConfig = {
|
||||||
@ -220,7 +220,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
const editor = await editorClass.create(elementOrData, finalConfig);
|
const editor = await editorClass.create(this.$editor[0], finalConfig);
|
||||||
|
|
||||||
const notificationsPlugin = editor.plugins.get("Notification");
|
const notificationsPlugin = editor.plugins.get("Notification");
|
||||||
notificationsPlugin.on("show:warning", (evt, data) => {
|
notificationsPlugin.on("show:warning", (evt, data) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user