Skip to content

Commit

Permalink
fix(editor): delete drafts in delete unique page
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Dec 7, 2021
1 parent 275a01d commit 145ade7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/editor/creative/drafts/EditorPagesDrafts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
>
{{ t('editor.drafts.chapters') }}
</div>
<Draggable :list="PROJECT.pages" item-key="id">
<Draggable v-model="PROJECT.pages" item-key="id">
<template #item="{ element }">
<div
class="text-center shadow cursor-pointer h-24 hover:bg-black-opacity text-lg w-full p-2 font-bold"
@click="onClickAside(element)"
>
<p class="relative top-6 truncate">
{{ element.title }}
{{ element.entities[0].raw }}
</p>
</div>
</template>
Expand Down
3 changes: 3 additions & 0 deletions src/store/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export const useProjectStore = defineStore('project', {

const index = this.pages.indexOf(content)

this.creative.drafts = this.creative.drafts.filter(
(draft) => draft.id !== content.id
)
this.pages.splice(index, 1)
},
updatePage(page: ContextState) {
Expand Down

0 comments on commit 145ade7

Please sign in to comment.