diff --git a/package.json b/package.json index 41f839db..77177b74 100644 --- a/package.json +++ b/package.json @@ -191,7 +191,7 @@ "emoji-mart-vue": "^2.6.6", "i18next": "^19.9.2", "lodash": "^4.17.21", - "megalodon": "3.5.2", + "megalodon": "3.6.0", "minimist": "^1.2.5", "moment": "^2.29.1", "mousetrap": "^1.6.5", diff --git a/spec/renderer/integration/store/Preferences/Notification.spec.ts b/spec/renderer/integration/store/Preferences/Notification.spec.ts index 649a4807..591f2c60 100644 --- a/spec/renderer/integration/store/Preferences/Notification.spec.ts +++ b/spec/renderer/integration/store/Preferences/Notification.spec.ts @@ -16,7 +16,7 @@ const state = (): NotificationState => { follow_request: true, reaction: true, status: true, - poll: true + poll_vote: true } } } @@ -66,7 +66,7 @@ describe('Preferences/Notification', () => { follow_request: false, reaction: false, status: false, - poll: false + poll_vote: false } } } @@ -85,7 +85,7 @@ describe('Preferences/Notification', () => { follow_request: false, reaction: false, status: false, - poll: false + poll_vote: false } }) }) @@ -115,7 +115,7 @@ describe('Preferences/Notification', () => { follow_request: true, reaction: true, status: true, - poll: true + poll_vote: true } }) expect(App.actions.loadPreferences).toBeCalled() diff --git a/spec/renderer/unit/store/Preferences/Notification.spec.ts b/spec/renderer/unit/store/Preferences/Notification.spec.ts index 9de079e7..801ad274 100644 --- a/spec/renderer/unit/store/Preferences/Notification.spec.ts +++ b/spec/renderer/unit/store/Preferences/Notification.spec.ts @@ -13,7 +13,7 @@ describe('Preferences/Notification', () => { follow_request: true, reaction: true, status: true, - poll: true + poll_vote: true } } } @@ -28,7 +28,8 @@ describe('Preferences/Notification', () => { follow: false, follow_request: false, reaction: false, - status: false + status: false, + poll_vote: false } }) expect(state.notification.notify).toEqual({ @@ -38,7 +39,8 @@ describe('Preferences/Notification', () => { follow: false, follow_request: false, reaction: false, - status: false + status: false, + poll_vote: false }) }) }) diff --git a/src/config/locales/en/translation.json b/src/config/locales/en/translation.json index af432c0f..7d3cefe1 100644 --- a/src/config/locales/en/translation.json +++ b/src/config/locales/en/translation.json @@ -197,7 +197,7 @@ "reaction": "Notify me when I receive a emoji reaction", "follow_request": "Notify me when I receive a follow request", "status": "Notify me when I receive a status notification", - "poll": "Notify me when I receive a vote of poll" + "poll_vote": "Notify me when I receive a vote of poll" } }, "account": { diff --git a/src/main/index.ts b/src/main/index.ts index be5f8da1..d4877819 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -1439,8 +1439,8 @@ const createNotification = (notification: Entity.Notification, notifyConfig: Not } as NotificationConstructorOptions } break - case NotificationType.Poll: - if (notifyConfig.poll) { + case NotificationType.PollVote: + if (notifyConfig.poll_vote) { return { title: i18next.t('notification.poll_vote.title'), body: i18next.t('notification.poll_vote.body', { username: username(notification.account) }), diff --git a/src/main/preferences.ts b/src/main/preferences.ts index 354fc488..1db4f3cb 100644 --- a/src/main/preferences.ts +++ b/src/main/preferences.ts @@ -50,7 +50,7 @@ const notify: Notify = { follow_request: true, reaction: true, status: true, - poll: true + poll_vote: true } const language: LanguageSet = { diff --git a/src/renderer/components/Preferences/Notification.vue b/src/renderer/components/Preferences/Notification.vue index 413eb82d..779c75ca 100644 --- a/src/renderer/components/Preferences/Notification.vue +++ b/src/renderer/components/Preferences/Notification.vue @@ -24,8 +24,8 @@ - - + + @@ -105,13 +105,13 @@ export default { }) } }, - notifyPoll: { + notifyPollVote: { get() { - return this.$store.state.Preferences.Notification.notification.notify.poll + return this.$store.state.Preferences.Notification.notification.notify.poll_vote }, set(value) { this.$store.dispatch('Preferences/Notification/updateNotify', { - poll: value + poll_vote: value }) } } diff --git a/src/renderer/components/organisms/Notification.vue b/src/renderer/components/organisms/Notification.vue index 9b2bc099..950d3986 100644 --- a/src/renderer/components/organisms/Notification.vue +++ b/src/renderer/components/organisms/Notification.vue @@ -97,7 +97,7 @@ > ({ follow_request: true, reaction: true, status: true, - poll: true + poll_vote: true }, tootPadding: 8, timeFormat: TimeFormat.Absolute.value, diff --git a/src/renderer/store/Preferences/Notification.ts b/src/renderer/store/Preferences/Notification.ts index fd3ddcf1..79c37e8e 100644 --- a/src/renderer/store/Preferences/Notification.ts +++ b/src/renderer/store/Preferences/Notification.ts @@ -20,7 +20,7 @@ const state: NotificationState = { follow_request: true, reaction: true, status: true, - poll: true + poll_vote: true } } } diff --git a/src/renderer/store/TimelineSpace/Contents/Mentions.ts b/src/renderer/store/TimelineSpace/Contents/Mentions.ts index 76af092e..85d619ca 100644 --- a/src/renderer/store/TimelineSpace/Contents/Mentions.ts +++ b/src/renderer/store/TimelineSpace/Contents/Mentions.ts @@ -106,7 +106,13 @@ const actions: ActionTree = { ) const res = await client.getNotifications({ limit: 30, - exclude_types: [NotificationType.Follow, NotificationType.Favourite, NotificationType.Reblog, NotificationType.Poll] + exclude_types: [ + NotificationType.Follow, + NotificationType.Favourite, + NotificationType.Reblog, + NotificationType.PollVote, + NotificationType.PollExpired + ] }) commit(MUTATION_TYPES.UPDATE_MENTIONS, res.data) return res.data @@ -126,7 +132,13 @@ const actions: ActionTree = { .getNotifications({ max_id: lastMention.id, limit: 30, - exclude_types: [NotificationType.Follow, NotificationType.Favourite, NotificationType.Reblog, NotificationType.Poll] + exclude_types: [ + NotificationType.Follow, + NotificationType.Favourite, + NotificationType.Reblog, + NotificationType.PollVote, + NotificationType.PollExpired + ] }) .then(res => { commit(MUTATION_TYPES.INSERT_MENTIONS, res.data) diff --git a/src/renderer/store/TimelineSpace/Contents/Notifications.ts b/src/renderer/store/TimelineSpace/Contents/Notifications.ts index 0ba62aa6..fd4de9c8 100644 --- a/src/renderer/store/TimelineSpace/Contents/Notifications.ts +++ b/src/renderer/store/TimelineSpace/Contents/Notifications.ts @@ -155,7 +155,7 @@ const getters: GetterTree = { case NotificationType.EmojiReaction: case NotificationType.FollowRequest: case NotificationType.Status: - case NotificationType.Poll: + case NotificationType.PollVote: return true default: return false diff --git a/src/types/notify.ts b/src/types/notify.ts index 455ab828..d76c7e52 100644 --- a/src/types/notify.ts +++ b/src/types/notify.ts @@ -6,5 +6,5 @@ export type Notify = { follow_request: boolean reaction: boolean status: boolean - poll: boolean + poll_vote: boolean } diff --git a/yarn.lock b/yarn.lock index fa30e976..41857759 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8840,10 +8840,10 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -megalodon@3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/megalodon/-/megalodon-3.5.2.tgz#9f3e3e42ba620bd0321de1d5255af3aece3f35d7" - integrity sha512-HuEeFa4HRGrgeZVsINz8qPOlZ130EgvJ0rXcOYS3Vn7XIv3LML50GsIUWHQbeaCEVDw/Vg3NOpXFBp/Lh+b6VQ== +megalodon@3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/megalodon/-/megalodon-3.6.0.tgz#924c497dc33f8be40032170c8d3fec286c7e78a0" + integrity sha512-iL0M2uro2Pmn6THHkpPis6QqiydTWAG3LijGQcNk2jaUIi96DnhERuHXAyZjleZdGHn3My/fgpUnY2fysx+YbA== dependencies: "@types/oauth" "^0.9.0" "@types/ws" "^7.2.0"