1
0
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:
Rokt33r
2015-12-28 18:29:48 +09:00
parent 5cfc418d77
commit 48fcd45d7d
2 changed files with 5 additions and 3 deletions

View File

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