forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 12
/
extended-notification.vue
47 lines (40 loc) · 1.14 KB
/
extended-notification.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<template>
<ui-card>
<template #title><fa :icon="faLightbulb"/> {{ $t('extended-notification') }}</template>
<section>
<header>{{ $t('highlighted-words') }}</header>
<ui-textarea v-model="highlightedWords">
{{ $t('highlighted-words') }}<template #desc>{{ $t('highlighted-words-description') }}</template>
</ui-textarea>
<ui-button @click="save">{{ $t('save') }}</ui-button>
</section>
</ui-card>
</template>
<script lang="ts">
import Vue from 'vue';
import i18n from '../../../../i18n';
import { faLightbulb } from '@fortawesome/free-regular-svg-icons';
export default Vue.extend({
i18n: i18n('common/views/components/settings/extended-notification.vue'),
data() {
return {
highlightedWords: '',
faLightbulb,
};
},
computed: {
_highlightedWords: {
get() { return this.$store.state.settings.highlightedWords; },
set(value) { this.$store.dispatch('settings/set', { key: 'highlightedWords', value }); }
},
},
mounted() {
this.highlightedWords = this._highlightedWords.join('\n');
},
methods: {
save() {
this._highlightedWords = this.highlightedWords.split('\n').filter((x: string) => x != '');
}
}
});
</script>