mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +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
|
||||
// its state to crashedPermanently, and it stops restarting the editor.
|
||||
// This prevents an infinite restart loop.
|
||||
crashNumberLimit: 3,
|
||||
crashNumberLimit: 10,
|
||||
// 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.
|
||||
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");
|
||||
|
||||
const finalConfig = {
|
||||
@ -220,7 +220,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
const editor = await editorClass.create(elementOrData, finalConfig);
|
||||
const editor = await editorClass.create(this.$editor[0], finalConfig);
|
||||
|
||||
const notificationsPlugin = editor.plugins.get("Notification");
|
||||
notificationsPlugin.on("show:warning", (evt, data) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user