tests moved to a proper place
This commit is contained in:
parent
201e2fb910
commit
e9b70fcb0e
4 changed files with 483 additions and 472 deletions
|
|
@ -76,7 +76,9 @@ const Draft = {
|
|||
},
|
||||
watch: {
|
||||
editing(newVal) {
|
||||
console.log('SAVE?', newVal)
|
||||
if (newVal) return
|
||||
console.log('SAVE', newVal)
|
||||
if (this.safeToSave) {
|
||||
useDraftsStore().addOrSaveDraft(this.draft)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ export const useDraftsStore = defineStore('drafts', {
|
|||
},
|
||||
async addOrSaveDraft(draft) {
|
||||
const id = draft.id ?? new Date().getTime().toString()
|
||||
console.log('SAVE', id)
|
||||
const draftWithId = { ...draft, id }
|
||||
this.drafts.set(draft.id, draftWithId)
|
||||
await saveDraftToStorage(draftWithId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue