core: deep clone note when duplicating

This commit is contained in:
ammarahm-ed
2023-04-25 11:07:50 +05:00
committed by Abdullah Atta
parent 21c8960146
commit a28beb62c6

View File

@@ -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,