mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Fix errorhandling on cases of invalid notes
This commit is contained in:
@@ -41,7 +41,7 @@ function init () {
|
|||||||
.then((notes) => {
|
.then((notes) => {
|
||||||
let unknownCount = 0
|
let unknownCount = 0
|
||||||
notes.forEach((note) => {
|
notes.forEach((note) => {
|
||||||
if (!storage.folders.some((folder) => note.folder === folder.key)) {
|
if (note && !storage.folders.some((folder) => note.folder === folder.key)) {
|
||||||
unknownCount++
|
unknownCount++
|
||||||
storage.folders.push({
|
storage.folders.push({
|
||||||
key: note.folder,
|
key: note.folder,
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ function resolveStorageNotes (storage) {
|
|||||||
return data
|
return data
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(notePath)
|
console.error(notePath)
|
||||||
throw err
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ function data (state = defaultDataMap(), action) {
|
|||||||
state.storageMap.set(storage.key, storage)
|
state.storageMap.set(storage.key, storage)
|
||||||
})
|
})
|
||||||
|
|
||||||
action.notes.forEach((note) => {
|
action.notes.some((note) => {
|
||||||
|
if (note === undefined) return true
|
||||||
let uniqueKey = note.storage + '-' + note.key
|
let uniqueKey = note.storage + '-' + note.key
|
||||||
let folderKey = note.storage + '-' + note.folder
|
let folderKey = note.storage + '-' + note.folder
|
||||||
state.noteMap.set(uniqueKey, note)
|
state.noteMap.set(uniqueKey, note)
|
||||||
|
|||||||
Reference in New Issue
Block a user