Skip to content

Commit 5163ab1

Browse files
committed
fix text
1 parent 73dd0db commit 5163ab1

4 files changed

Lines changed: 4 additions & 2 deletions

File tree

browser/main/lib/dataApi/createNote.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function createNote (storageKey, input) {
5959
while (!isUnique) {
6060
try {
6161
sander.statSync(path.join(storage.path, 'notes', key + '.cson'))
62+
key = keygen()
6263
} catch (err) {
6364
if (err.code === 'ENOENT') {
6465
isUnique = true

browser/main/lib/dataApi/updateFolder.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function updateFolder (storageKey, folderKey, input) {
4141
return resolveStorageData(targetStorage)
4242
.then(function updateFolder (storage) {
4343
let targetFolder = _.find(storage.folders, {key: folderKey})
44+
if (targetFolder == null) throw new Error('Target folder doesn\'t exist.')
4445
targetFolder.name = input.name
4546
targetFolder.color = input.color
4647

tests/dataApi/deleteNote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test.beforeEach((t) => {
2222
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
2323
})
2424

25-
test.serial('Create a note', (t) => {
25+
test.serial('Delete a note', (t) => {
2626
const storageKey = t.context.storage.cache.key
2727
const folderKey = t.context.storage.json.folders[0].key
2828

tests/dataApi/updateNote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test.beforeEach((t) => {
2222
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
2323
})
2424

25-
test.serial('Create a note', (t) => {
25+
test.serial('Update a note', (t) => {
2626
const storageKey = t.context.storage.cache.key
2727
const folderKey = t.context.storage.json.folders[0].key
2828

0 commit comments

Comments
 (0)