diff --git a/src/models/index.ts b/src/models/index.ts index e4335ce901..dee06f2af0 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -189,15 +189,32 @@ export const realm = new Realm({ value: boolean; }>('VariablesBool'); + let removeIndex = -1; for (const objectIndex in oldObjects) { const newObject = newObjects[objectIndex]; - if (newObject.id === 'isDeveloper' || newObject.id === 'isTesterMode') { - //@ts-ignore - delete newObject[objectIndex]; + if (newObject.id === 'isDeveloper') { + removeIndex = objectIndex as never as number; } } + if (removeIndex !== -1) { + newObjects.slice(removeIndex, removeIndex + 1); + } + + removeIndex = -1; + for (const objectIndex in oldObjects) { + const newObject = newObjects[objectIndex]; + + if (newObject.id === 'isTesterMode') { + removeIndex = objectIndex as never as number; + } + } + + if (removeIndex !== -1) { + newObjects.slice(removeIndex, removeIndex + 1); + } + logger.log({ oldObjects: oldObjects.toJSON(), newObjects: newObjects.toJSON(),