mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
fix text
This commit is contained in:
@@ -59,6 +59,7 @@ function createNote (storageKey, input) {
|
|||||||
while (!isUnique) {
|
while (!isUnique) {
|
||||||
try {
|
try {
|
||||||
sander.statSync(path.join(storage.path, 'notes', key + '.cson'))
|
sander.statSync(path.join(storage.path, 'notes', key + '.cson'))
|
||||||
|
key = keygen()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.code === 'ENOENT') {
|
if (err.code === 'ENOENT') {
|
||||||
isUnique = true
|
isUnique = true
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ function updateFolder (storageKey, folderKey, input) {
|
|||||||
return resolveStorageData(targetStorage)
|
return resolveStorageData(targetStorage)
|
||||||
.then(function updateFolder (storage) {
|
.then(function updateFolder (storage) {
|
||||||
let targetFolder = _.find(storage.folders, {key: folderKey})
|
let targetFolder = _.find(storage.folders, {key: folderKey})
|
||||||
|
if (targetFolder == null) throw new Error('Target folder doesn\'t exist.')
|
||||||
targetFolder.name = input.name
|
targetFolder.name = input.name
|
||||||
targetFolder.color = input.color
|
targetFolder.color = input.color
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ test.beforeEach((t) => {
|
|||||||
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
|
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
|
||||||
})
|
})
|
||||||
|
|
||||||
test.serial('Create a note', (t) => {
|
test.serial('Delete a note', (t) => {
|
||||||
const storageKey = t.context.storage.cache.key
|
const storageKey = t.context.storage.cache.key
|
||||||
const folderKey = t.context.storage.json.folders[0].key
|
const folderKey = t.context.storage.json.folders[0].key
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ test.beforeEach((t) => {
|
|||||||
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
|
localStorage.setItem('storages', JSON.stringify([t.context.storage.cache]))
|
||||||
})
|
})
|
||||||
|
|
||||||
test.serial('Create a note', (t) => {
|
test.serial('Update a note', (t) => {
|
||||||
const storageKey = t.context.storage.cache.key
|
const storageKey = t.context.storage.cache.key
|
||||||
const folderKey = t.context.storage.json.folders[0].key
|
const folderKey = t.context.storage.json.folders[0].key
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user