summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-02-05 01:24:44 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-02-05 01:24:44 +0900
commit1d814ba0e124e97ec72361254f42a76f6a0449ae (patch)
treeae18ea8043b73b6cd3dd0d5804d48b5b02869550 /src/client
parent[API] お気に入り状態は投稿情報に含めないように統一 (diff)
downloadmisskey-1d814ba0e124e97ec72361254f42a76f6a0449ae.tar.gz
misskey-1d814ba0e124e97ec72361254f42a76f6a0449ae.tar.bz2
misskey-1d814ba0e124e97ec72361254f42a76f6a0449ae.zip
個別に投稿のウォッチ/ウォッチ解除をできるように
Resolve #161
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/common/views/components/note-menu.vue39
1 files changed, 37 insertions, 2 deletions
diff --git a/src/client/app/common/views/components/note-menu.vue b/src/client/app/common/views/components/note-menu.vue
index ecea08b756..b83d5c3259 100644
--- a/src/client/app/common/views/components/note-menu.vue
+++ b/src/client/app/common/views/components/note-menu.vue
@@ -10,14 +10,15 @@ import i18n from '../../../i18n';
import { url } from '../../../config';
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
import { concat, intersperse } from '../../../../../prelude/array';
-import { faCopy } from '@fortawesome/free-regular-svg-icons';
+import { faCopy, faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons';
export default Vue.extend({
i18n: i18n('common/views/components/note-menu.vue'),
props: ['note', 'source'],
data() {
return {
- isFavorited: false
+ isFavorited: false,
+ isWatching: false
};
},
computed: {
@@ -55,6 +56,15 @@ export default Vue.extend({
text: this.$t('favorite'),
action: this.favorite
},
+ this.note.userId != this.$store.state.i.id ? this.isWatching ? {
+ icon: faEyeSlash,
+ text: this.$t('unwatch'),
+ action: this.unwatch
+ } : {
+ icon: faEye,
+ text: this.$t('watch'),
+ action: this.watch
+ } : undefined,
this.note.userId == this.$store.state.i.id ? (this.$store.state.i.pinnedNoteIds || []).includes(this.note.id) ? {
icon: 'thumbtack',
text: this.$t('unpin'),
@@ -78,6 +88,7 @@ export default Vue.extend({
noteId: this.note.id
}).then(state => {
this.isFavorited = state.isFavorited;
+ this.isWatching = state.isWatching;
});
},
@@ -166,6 +177,30 @@ export default Vue.extend({
});
},
+ watch() {
+ this.$root.api('notes/watching/create', {
+ noteId: this.note.id
+ }).then(() => {
+ this.$root.dialog({
+ type: 'success',
+ splash: true
+ });
+ this.destroyDom();
+ });
+ },
+
+ unwatch() {
+ this.$root.api('notes/watching/delete', {
+ noteId: this.note.id
+ }).then(() => {
+ this.$root.dialog({
+ type: 'success',
+ splash: true
+ });
+ this.destroyDom();
+ });
+ },
+
closed() {
this.$nextTick(() => {
this.destroyDom();