mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
debug on saving data & error throw if dataStore get wrong data
This commit is contained in:
@@ -110,12 +110,14 @@ export function getData () {
|
||||
}
|
||||
|
||||
export function setArticles (articles) {
|
||||
if (!_.isArray(articles)) throw new Error('Articles must be an array')
|
||||
let data = getData()
|
||||
data.articles = articles
|
||||
jetpack.write(getLocalPath(), data)
|
||||
}
|
||||
|
||||
export function setFolders (folders) {
|
||||
if (!_.isArray(folders)) throw new Error('Folders must be an array')
|
||||
let data = getData()
|
||||
data.folders = folders
|
||||
jetpack.write(getLocalPath(), data)
|
||||
|
||||
Reference in New Issue
Block a user