From c12e6f86286dea2bfde4207ba385dc341d6c2ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=A8=E3=81=82=E3=81=B5?= <128669695+hibiyahibiyahibiya@users.noreply.github.com> Date: Tue, 5 Sep 2023 09:15:23 +0000 Subject: [PATCH] =?UTF-8?q?/groups=20=E3=83=96=E3=83=83=E3=82=AF=E3=83=9E?= =?UTF-8?q?=E3=83=BC=E3=82=AF=E6=A9=9F=E6=A7=8B=E3=81=AE=E6=9C=80=E9=81=A9?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/groups/index.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pages/groups/index.vue b/pages/groups/index.vue index 4d114da1..352a2568 100644 --- a/pages/groups/index.vue +++ b/pages/groups/index.vue @@ -231,6 +231,7 @@ type Data = { sort_displayname: string query_cache: any search_result_number: number + storage_bookmarks: (string | null)[] display_bookmarks: boolean selectedTag: Tag | undefined } @@ -255,6 +256,7 @@ export default Vue.extend({ search_result_number: 0, search_query: '', sort_displayname: 'デフォルト順', + storage_bookmarks: [], display_bookmarks: false, query_cache: undefined, } @@ -321,6 +323,9 @@ export default Vue.extend({ } }, mounted() { + for (let i = 0; i < localStorage.length; i++) { + this.storage_bookmarks.push(localStorage.key(i)) + } this.nowloading = false }, @@ -334,6 +339,7 @@ export default Vue.extend({ R = R === null ? this.$route.query.r : R this.$router.push({ query: { q: Q, t: T, b: B, s: S, r: R } }) // nullは「現在のクエリを維持」と同義 }, + SortGroups(sort: 'id' | 'groupname' | 'title') { if (sort === 'groupname') { this.sort_displayname = '団体名順' @@ -439,13 +445,13 @@ export default Vue.extend({ FilterBookmarks(id: string) { // お気に入りならtrue - if (this.nowloading === true) return false - for (let i = 0; i < localStorage.length; i++) { - if ('seiryofes.groups.favorite.' + id === localStorage.key(i)) { - return true - } + if (this.nowloading === true) { + return false + } else { + return this.storage_bookmarks.includes( + 'seiryofes.groups.favorite.' + id + ) } - return false }, HashColor(text: string) {