mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-23 19:49:56 +01:00
core: deep clone note when duplicating
This commit is contained in:
committed by
Abdullah Atta
parent
21c8960146
commit
a28beb62c6
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user