From a28beb62c66f60f23e458fab09f3a4f2a9e90c77 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 25 Apr 2023 11:07:50 +0500 Subject: [PATCH] core: deep clone note when duplicating --- packages/core/models/note.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/core/models/note.js b/packages/core/models/note.js index 3148e36d3..c1f79e62a 100644 --- a/packages/core/models/note.js +++ b/packages/core/models/note.js @@ -24,6 +24,7 @@ import { getContentFromData } from "../content-types"; import { CHECK_IDS, checkIsUserPremium } from "../common"; import { addItem, deleteItem } from "../utils/array"; import { formatDate } from "../utils/date"; +import qclone from "qclone"; export default class Note { /** @@ -135,7 +136,7 @@ export default class Note { async duplicate() { const content = await this._db.content.raw(this._note.contentId); return await this._db.notes.add({ - ...this._note, + ...qclone(this._note), id: undefined, content: { type: content.type,