summaryrefslogtreecommitdiff
path: root/src/client/app/common/views/components
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-09-24 16:26:12 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-09-24 16:26:12 +0900
commit59d67d314069c19dcc5c2c7d82f260a9f8c661cd (patch)
tree06d7298ed62c6ae141c4a380e41792a38951a14b /src/client/app/common/views/components
parent:art: (diff)
downloadmisskey-59d67d314069c19dcc5c2c7d82f260a9f8c661cd.tar.gz
misskey-59d67d314069c19dcc5c2c7d82f260a9f8c661cd.tar.bz2
misskey-59d67d314069c19dcc5c2c7d82f260a9f8c661cd.zip
ピン留めを解除することができるようにしたり
Diffstat (limited to 'src/client/app/common/views/components')
-rw-r--r--src/client/app/common/views/components/note-menu.vue27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/client/app/common/views/components/note-menu.vue b/src/client/app/common/views/components/note-menu.vue
index 08fae46dd6..a3e80e33de 100644
--- a/src/client/app/common/views/components/note-menu.vue
+++ b/src/client/app/common/views/components/note-menu.vue
@@ -28,11 +28,19 @@ export default Vue.extend({
}];
if (this.note.userId == this.$store.state.i.id) {
- items.push({
- icon: '%fa:thumbtack%',
- text: '%i18n:@pin%',
- action: this.pin
- });
+ if (this.$store.state.i.pinnedNoteIds.includes(this.note.id)) {
+ items.push({
+ icon: '%fa:thumbtack%',
+ text: '%i18n:@unpin%',
+ action: this.unpin
+ });
+ } else {
+ items.push({
+ icon: '%fa:thumbtack%',
+ text: '%i18n:@pin%',
+ action: this.pin
+ });
+ }
}
if (this.note.userId == this.$store.state.i.id || this.$store.state.i.isAdmin) {
@@ -56,6 +64,7 @@ export default Vue.extend({
return items;
}
},
+
methods: {
detail() {
this.$router.push(`/notes/${ this.note.id }`);
@@ -73,6 +82,14 @@ export default Vue.extend({
});
},
+ unpin() {
+ (this as any).api('i/unpin', {
+ noteId: this.note.id
+ }).then(() => {
+ this.destroyDom();
+ });
+ },
+
del() {
if (!window.confirm('%i18n:@delete-confirm%')) return;
(this as any).api('notes/delete', {