refs #2287 Handle poll expired notification in streaming
This commit is contained in:
parent
4fc4b6b2c9
commit
8b3a9b281e
|
@ -16,7 +16,8 @@ const state = (): NotificationState => {
|
|||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true,
|
||||
poll_vote: true
|
||||
poll_vote: true,
|
||||
poll_expired: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +67,8 @@ describe('Preferences/Notification', () => {
|
|||
follow_request: false,
|
||||
reaction: false,
|
||||
status: false,
|
||||
poll_vote: false
|
||||
poll_vote: false,
|
||||
poll_expired: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -85,7 +87,8 @@ describe('Preferences/Notification', () => {
|
|||
follow_request: false,
|
||||
reaction: false,
|
||||
status: false,
|
||||
poll_vote: false
|
||||
poll_vote: false,
|
||||
poll_expired: false
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -115,7 +118,8 @@ describe('Preferences/Notification', () => {
|
|||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true,
|
||||
poll_vote: true
|
||||
poll_vote: true,
|
||||
poll_expired: true
|
||||
}
|
||||
})
|
||||
expect(App.actions.loadPreferences).toBeCalled()
|
||||
|
|
|
@ -13,7 +13,8 @@ describe('Preferences/Notification', () => {
|
|||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true,
|
||||
poll_vote: true
|
||||
poll_vote: true,
|
||||
poll_expired: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +30,8 @@ describe('Preferences/Notification', () => {
|
|||
follow_request: false,
|
||||
reaction: false,
|
||||
status: false,
|
||||
poll_vote: false
|
||||
poll_vote: false,
|
||||
poll_expired: false
|
||||
}
|
||||
})
|
||||
expect(state.notification.notify).toEqual({
|
||||
|
@ -40,7 +42,8 @@ describe('Preferences/Notification', () => {
|
|||
follow_request: false,
|
||||
reaction: false,
|
||||
status: false,
|
||||
poll_vote: false
|
||||
poll_vote: false,
|
||||
poll_expired: false
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -197,7 +197,8 @@
|
|||
"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_vote": "Notify me when I receive a vote of poll"
|
||||
"poll_vote": "Notify me when I receive a vote of poll",
|
||||
"poll_expired": "Notify me when I receive a poll expired event"
|
||||
}
|
||||
},
|
||||
"account": {
|
||||
|
|
|
@ -1448,6 +1448,15 @@ const createNotification = (notification: Entity.Notification, notifyConfig: Not
|
|||
} as NotificationConstructorOptions
|
||||
}
|
||||
break
|
||||
case NotificationType.PollExpired:
|
||||
if (notifyConfig.poll_expired) {
|
||||
return {
|
||||
title: i18next.t('notification.poll_expired.title'),
|
||||
body: i18next.t('notification.poll_expired.body', { username: username(notification.account) }),
|
||||
silent: false
|
||||
} as NotificationConstructorOptions
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ const notify: Notify = {
|
|||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true,
|
||||
poll_vote: true
|
||||
poll_vote: true,
|
||||
poll_expired: true
|
||||
}
|
||||
|
||||
const language: LanguageSet = {
|
||||
|
|
|
@ -24,9 +24,12 @@
|
|||
<el-form-item for="notifyStatus" :label="$t('preferences.notification.enable.status')">
|
||||
<el-switch v-model="notifyStatus" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item from="notifyPollVote" :label="$t('preferences.notification.enable.poll_vote')">
|
||||
<el-form-item for="notifyPollVote" :label="$t('preferences.notification.enable.poll_vote')">
|
||||
<el-switch v-model="notifyPollVote" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item for="notifyPollExpired" :label="$t('preferences.notification.enable.poll_expired')">
|
||||
<el-switch v-model="notifyPollExpired" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -114,6 +117,16 @@ export default {
|
|||
poll_vote: value
|
||||
})
|
||||
}
|
||||
},
|
||||
notifyPollExpired: {
|
||||
get() {
|
||||
return this.$store.state.Preferences.Notification.notification.notify.poll_expired
|
||||
},
|
||||
set(value) {
|
||||
this.$store.dispatch('Preferences/Notification/updateNotify', {
|
||||
poll_expired: value
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -86,6 +86,7 @@ export default {
|
|||
|
||||
.notified-status {
|
||||
padding-top: 8px;
|
||||
|
||||
.action {
|
||||
padding: 0 0 0 16px;
|
||||
margin-right: 8px;
|
||||
|
|
|
@ -41,7 +41,8 @@ const state = (): AppState => ({
|
|||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true,
|
||||
poll_vote: true
|
||||
poll_vote: true,
|
||||
poll_expired: true
|
||||
},
|
||||
tootPadding: 8,
|
||||
timeFormat: TimeFormat.Absolute.value,
|
||||
|
|
|
@ -20,7 +20,8 @@ const state: NotificationState = {
|
|||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true,
|
||||
poll_vote: true
|
||||
poll_vote: true,
|
||||
poll_expired: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,4 +7,5 @@ export type Notify = {
|
|||
reaction: boolean
|
||||
status: boolean
|
||||
poll_vote: boolean
|
||||
poll_expired: boolean
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue