From 5ec2a485711014b8d88401e6f1b711b3c00e9707 Mon Sep 17 00:00:00 2001 From: AkiraFukushima Date: Sun, 29 Jan 2023 21:57:54 +0900 Subject: [PATCH 1/7] [refactor] Remove public timeline store --- .../TimelineSpace/Contents/DirectMessages.vue | 10 +- .../TimelineSpace/Contents/Favourites.vue | 10 +- .../TimelineSpace/Contents/Home.vue | 10 +- .../TimelineSpace/Contents/Public.vue | 100 +++++++++------ src/renderer/components/organisms/Toot.vue | 4 +- src/renderer/store/GlobalHeader.ts | 9 -- src/renderer/store/TimelineSpace/Contents.ts | 3 - .../store/TimelineSpace/Contents/Public.ts | 114 ------------------ 8 files changed, 82 insertions(+), 178 deletions(-) delete mode 100644 src/renderer/store/TimelineSpace/Contents/Public.ts diff --git a/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue b/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue index 9f3118c0ce..84465c8f34 100644 --- a/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue +++ b/src/renderer/components/TimelineSpace/Contents/DirectMessages.vue @@ -11,9 +11,9 @@ :filters="[]" :account="account.account" :server="account.server" - v-on:update="updateToot" - v-on:delete="deleteToot" - @selectToot="focusToot(item)" + @update="updateToot" + @delete="deleteToot" + @select-toot="focusToot(item)" > @@ -132,9 +132,9 @@ export default defineComponent({ store.commit(`${space}/${MUTATION_TYPES.UPDATE_TOOT}`, { status: message, accountId: account.account.id }) } } - const deleteToot = (message: Entity.Status) => { + const deleteToot = (id: string) => { if (account.account) { - store.commit(`${space}/${MUTATION_TYPES.DELETE_TOOT}`, { statusId: message.id, accountId: account.account.id }) + store.commit(`${space}/${MUTATION_TYPES.DELETE_TOOT}`, { statusId: id, accountId: account.account.id }) } } const upper = () => { diff --git a/src/renderer/components/TimelineSpace/Contents/Favourites.vue b/src/renderer/components/TimelineSpace/Contents/Favourites.vue index 0f25e0f617..85dc88b3b9 100644 --- a/src/renderer/components/TimelineSpace/Contents/Favourites.vue +++ b/src/renderer/components/TimelineSpace/Contents/Favourites.vue @@ -12,9 +12,9 @@ :filters="[]" :account="account.account" :server="account.server" - v-on:update="updateToot" - v-on:delete="deleteToot" - @selectToot="focusToot(item)" + @update="updateToot" + @delete="deleteToot" + @select-toot="focusToot(item)" > @@ -150,8 +150,8 @@ export default defineComponent({ const updateToot = (message: Entity.Status) => { store.commit(`${space}/${MUTATION_TYPES.UPDATE_TOOT}`, message) } - const deleteToot = (message: Entity.Status) => { - store.commit(`${space}/${MUTATION_TYPES.DELETE_TOOT}`, message) + const deleteToot = (id: string) => { + store.commit(`${space}/${MUTATION_TYPES.DELETE_TOOT}`, id) } const reload = async () => { store.commit(`TimelineSpace/${TIMELINE_MUTATION.CHANGE_LOADING}`, true) diff --git a/src/renderer/components/TimelineSpace/Contents/Home.vue b/src/renderer/components/TimelineSpace/Contents/Home.vue index 21507e6896..67490fca6d 100644 --- a/src/renderer/components/TimelineSpace/Contents/Home.vue +++ b/src/renderer/components/TimelineSpace/Contents/Home.vue @@ -17,9 +17,9 @@ :filters="filters" :account="account.account" :server="account.server" - v-on:update="updateToot" - v-on:delete="deleteToot" - @selectToot="focusToot(item)" + @update="updateToot" + delete="deleteToot" + @select-toot="focusToot(item)" > @@ -180,9 +180,9 @@ export default defineComponent({ store.commit(`${space}/${MUTATION_TYPES.UPDATE_TOOT}`, { status: message, accountId: account.account.id }) } } - const deleteToot = (message: Entity.Status) => { + const deleteToot = (id: string) => { if (account.account) { - store.commit(`${space}/${MUTATION_TYPES.DELETE_TOOT}`, { statusId: message.id, accountId: account.account.id }) + store.commit(`${space}/${MUTATION_TYPES.DELETE_TOOT}`, { statusId: id, accountId: account.account.id }) } } const fetchTimelineSince = (since_id: string) => { diff --git a/src/renderer/components/TimelineSpace/Contents/Public.vue b/src/renderer/components/TimelineSpace/Contents/Public.vue index 4735b9b262..293ba4a80e 100644 --- a/src/renderer/components/TimelineSpace/Contents/Public.vue +++ b/src/renderer/components/TimelineSpace/Contents/Public.vue @@ -1,6 +1,7 @@