From f3ea4b1f3bb09491758508a62f66dd459ff30a71 Mon Sep 17 00:00:00 2001 From: patak Date: Tue, 15 Nov 2022 22:20:07 +0100 Subject: [PATCH] feat: bookmarks --- components/nav/NavSide.vue | 4 ++-- components/status/StatusActions.vue | 20 ++++++++++++++++++++ pages/bookmarks.vue | 22 ++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 pages/bookmarks.vue diff --git a/components/nav/NavSide.vue b/components/nav/NavSide.vue index fa736904..1c3ae571 100644 --- a/components/nav/NavSide.vue +++ b/components/nav/NavSide.vue @@ -32,8 +32,8 @@
Favorites - -
+ +
Bookmarks
diff --git a/components/status/StatusActions.vue b/components/status/StatusActions.vue index 1e29d27d..743263f6 100644 --- a/components/status/StatusActions.vue +++ b/components/status/StatusActions.vue @@ -19,6 +19,17 @@ async function toggleFavourite() { isLoading.value = false } } + +async function toggleBookmark() { + try { + isLoading.value = true + const action = status.bookmarked ? 'unbookmark' : 'bookmark' + Object.assign(status, await masto.statuses[action](status.id)) + } + finally { + isLoading.value = false + } +}