refs #2204 Create desktop notification when received poll notification
This commit is contained in:
parent
eaecb8ad4e
commit
70b877f9f0
|
@ -15,7 +15,8 @@ const state = (): NotificationState => {
|
|||
follow: true,
|
||||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true
|
||||
status: true,
|
||||
poll: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,8 @@ describe('Preferences/Notification', () => {
|
|||
follow: true,
|
||||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true
|
||||
status: true,
|
||||
poll: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -196,7 +196,8 @@
|
|||
"follow": "Notify me when I receive a follow",
|
||||
"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"
|
||||
"status": "Notify me when I receive a status notification",
|
||||
"poll": "Notify me when I receive a vote of poll"
|
||||
}
|
||||
},
|
||||
"account": {
|
||||
|
|
|
@ -1439,6 +1439,15 @@ const createNotification = (notification: Entity.Notification, notifyConfig: Not
|
|||
} as NotificationConstructorOptions
|
||||
}
|
||||
break
|
||||
case NotificationType.Poll:
|
||||
if (notifyConfig.poll) {
|
||||
return {
|
||||
title: i18next.t('notification.poll_vote.title'),
|
||||
body: i18next.t('notification.poll_vote.body', { username: username(notification.account) }),
|
||||
silent: false
|
||||
} as NotificationConstructorOptions
|
||||
}
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ const notify: Notify = {
|
|||
follow: true,
|
||||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true
|
||||
status: true,
|
||||
poll: true
|
||||
}
|
||||
|
||||
const language: LanguageSet = {
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
<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="notifyPoll" :label="$t('preferences.notification.enable.poll')">
|
||||
<el-switch v-model="notifyPoll" active-color="#13ce66"> </el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -101,6 +104,16 @@ export default {
|
|||
status: value
|
||||
})
|
||||
}
|
||||
},
|
||||
notifyPoll: {
|
||||
get() {
|
||||
return this.$store.state.Preferences.Notification.notification.notify.poll
|
||||
},
|
||||
set(value) {
|
||||
this.$store.dispatch('Preferences/Notification/updateNotify', {
|
||||
poll: value
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -40,7 +40,8 @@ const state = (): AppState => ({
|
|||
follow: true,
|
||||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true
|
||||
status: true,
|
||||
poll: true
|
||||
},
|
||||
tootPadding: 8,
|
||||
timeFormat: TimeFormat.Absolute.value,
|
||||
|
|
|
@ -19,7 +19,8 @@ const state: NotificationState = {
|
|||
follow: true,
|
||||
follow_request: true,
|
||||
reaction: true,
|
||||
status: true
|
||||
status: true,
|
||||
poll: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,4 +6,5 @@ export type Notify = {
|
|||
follow_request: boolean
|
||||
reaction: boolean
|
||||
status: boolean
|
||||
poll: boolean
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue