fx-compat: Avoid dead object errors in note-editor

Fixes #2663
This commit is contained in:
Martynas Bagdonas 2022-06-20 11:33:10 +03:00
parent b3077182d2
commit 5b879f75c5

View file

@ -501,6 +501,7 @@ class EditorInstance {
} }
case 'subscribe': { case 'subscribe': {
let { subscription } = message; let { subscription } = message;
subscription = JSON.parse(JSON.stringify(subscription));
this._subscriptions.push(subscription); this._subscriptions.push(subscription);
if (subscription.type === 'image') { if (subscription.type === 'image') {
await this._feedSubscription(subscription); await this._feedSubscription(subscription);
@ -515,6 +516,7 @@ class EditorInstance {
// Called on note editor load // Called on note editor load
case 'updateCitationItemsList': { case 'updateCitationItemsList': {
let { list } = message; let { list } = message;
list = list.slice();
let newList = []; let newList = [];
for (let item of list) { for (let item of list) {
let existingItem = this._citationItemsList let existingItem = this._citationItemsList