refs #2088 Add notification preference for status notification

This commit is contained in:
AkiraFukushima 2021-03-02 11:28:03 +09:00
parent a2a58a3ead
commit 136e9db4b6
8 changed files with 41 additions and 11 deletions

View File

@ -14,7 +14,8 @@ const state = (): NotificationState => {
favourite: true, favourite: true,
follow: true, follow: true,
follow_request: true, follow_request: true,
reaction: true reaction: true,
status: true
} }
} }
} }
@ -62,7 +63,8 @@ describe('Preferences/Notification', () => {
favourite: false, favourite: false,
follow: false, follow: false,
follow_request: false, follow_request: false,
reaction: false reaction: false,
status: false
} }
} }
} }
@ -79,7 +81,8 @@ describe('Preferences/Notification', () => {
favourite: false, favourite: false,
follow: false, follow: false,
follow_request: false, follow_request: false,
reaction: false reaction: false,
status: false
} }
}) })
}) })
@ -107,7 +110,8 @@ describe('Preferences/Notification', () => {
favourite: true, favourite: true,
follow: true, follow: true,
follow_request: true, follow_request: true,
reaction: true reaction: true,
status: true
} }
}) })
expect(App.actions.loadPreferences).toBeCalled() expect(App.actions.loadPreferences).toBeCalled()

View File

@ -11,7 +11,8 @@ describe('Preferences/Notification', () => {
favourite: true, favourite: true,
follow: true, follow: true,
follow_request: true, follow_request: true,
reaction: true reaction: true,
status: true
} }
} }
} }
@ -23,14 +24,20 @@ describe('Preferences/Notification', () => {
reply: false, reply: false,
reblog: false, reblog: false,
favourite: false, favourite: false,
follow: false follow: false,
follow_request: false,
reaction: false,
status: false
} }
}) })
expect(state.notification.notify).toEqual({ expect(state.notification.notify).toEqual({
reply: false, reply: false,
reblog: false, reblog: false,
favourite: false, favourite: false,
follow: false follow: false,
follow_request: false,
reaction: false,
status: false
}) })
}) })
}) })

View File

@ -194,7 +194,9 @@
"reblog": "Notify me when I receive a reblog", "reblog": "Notify me when I receive a reblog",
"favourite": "Notify me when I receive a favourite", "favourite": "Notify me when I receive a favourite",
"follow": "Notify me when I receive a follow", "follow": "Notify me when I receive a follow",
"reaction": "Notify me when I receive a emoji reaction" "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"
} }
}, },
"account": { "account": {

View File

@ -48,7 +48,8 @@ const notify: Notify = {
favourite: true, favourite: true,
follow: true, follow: true,
follow_request: true, follow_request: true,
reaction: true reaction: true,
status: true
} }
const language: LanguageSet = { const language: LanguageSet = {

View File

@ -21,6 +21,9 @@
<el-form-item for="notifyFollowRequest" :label="$t('preferences.notification.enable.follow_request')"> <el-form-item for="notifyFollowRequest" :label="$t('preferences.notification.enable.follow_request')">
<el-switch v-model="notifyFollowRequest" active-color="#13ce66"> </el-switch> <el-switch v-model="notifyFollowRequest" active-color="#13ce66"> </el-switch>
</el-form-item> </el-form-item>
<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> </el-form>
</div> </div>
</template> </template>
@ -88,6 +91,16 @@ export default {
reaction: value reaction: value
}) })
} }
},
notifyStatus: {
get() {
return this.$store.state.Preferences.Notification.notification.notify.status
},
set(value) {
this.$store.dispatch('Preferences/Notification/updateNotify', {
status: value
})
}
} }
}, },
created() { created() {

View File

@ -39,7 +39,8 @@ const state = (): AppState => ({
favourite: true, favourite: true,
follow: true, follow: true,
follow_request: true, follow_request: true,
reaction: true reaction: true,
status: true
}, },
tootPadding: 8, tootPadding: 8,
timeFormat: TimeFormat.Absolute.value, timeFormat: TimeFormat.Absolute.value,

View File

@ -18,7 +18,8 @@ const state: NotificationState = {
favourite: true, favourite: true,
follow: true, follow: true,
follow_request: true, follow_request: true,
reaction: true reaction: true,
status: true
} }
} }
} }

View File

@ -5,4 +5,5 @@ export type Notify = {
follow: boolean follow: boolean
follow_request: boolean follow_request: boolean
reaction: boolean reaction: boolean
status: boolean
} }