Skip to content

Commit

Permalink
fix(post save): virtualization issue
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Mar 11, 2024
1 parent 8e3b9d3 commit 96583aa
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions components/pages/posts/post/PostSave.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<script lang="ts" setup>
import { BookmarkIcon } from '@heroicons/vue/24/outline'
import { BookmarkIcon as SolidBookmarkIcon } from '@heroicons/vue/24/solid'
import { db } from '~/store/SavedPosts'
import { liveQuery } from 'dexie'
import { useObservable } from '@vueuse/rxjs'
import type { IPost } from '~/assets/js/post'
import { liveQuery } from 'dexie'
import { cloneDeep } from 'lodash-es'
import { toast } from 'vue-sonner'
import type { IPost } from '~/assets/js/post'
import { db } from '~/store/SavedPosts'
// TODO: Load this component in <suspense>
Expand Down Expand Up @@ -57,12 +58,17 @@
}
async function savePost() {
const post = cloneDeep(props.post)
// Fix: remove virtualization data
delete post.current_page
await db.posts.put({
original_id: toRaw(props.post.id),
original_id: props.post.id,
original_domain: props.domain,
data: toRaw(props.post)
data: post
})
}
Expand Down

0 comments on commit 96583aa

Please sign in to comment.