mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 15:39:44 +01:00
refactor: use qclone for deep copying topics
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import Notebooks from "./notebooks";
|
||||
import Notes from "./notes";
|
||||
import Topic from "../models/topic";
|
||||
import { qclone } from "qclone";
|
||||
|
||||
export default class Topics {
|
||||
/**
|
||||
@@ -59,7 +60,7 @@ export default class Topics {
|
||||
}
|
||||
|
||||
async delete(...topics) {
|
||||
let allTopics = JSON.parse(JSON.stringify(this.all)); //FIXME: make a deep copy
|
||||
let allTopics = qclone(this.all); //FIXME: make a deep copy
|
||||
for (let i = 0; i < allTopics.length; i++) {
|
||||
let topic = allTopics[i];
|
||||
if (!topic) continue;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"fast-sort": "^2.0.1",
|
||||
"fuzzysearch": "^1.0.3",
|
||||
"node-fetch": "^2.6.0",
|
||||
"qclone": "^1.0.4",
|
||||
"transfun": "^1.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3807,6 +3807,11 @@ punycode@^2.1.0, punycode@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
|
||||
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==
|
||||
|
||||
qclone@^1.0.4:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/qclone/-/qclone-1.0.4.tgz#a0e6657f6a77c5e5dfa75139670a177547120c4e"
|
||||
integrity sha512-PJerDoeC0mU6WCBfshfgu6oYPju7CDHlvF/7tt/ZVN37L04nZ0zZSgs0Ds3QyX7psfPA91DvkTR80WTW79Uy+Q==
|
||||
|
||||
qs@~6.5.2:
|
||||
version "6.5.2"
|
||||
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
|
||||
|
||||
Reference in New Issue
Block a user