diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-28 10:35:53 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-28 10:35:53 +0900 |
| commit | 66409029e76949593a80063651f755f7d37d054e (patch) | |
| tree | b5c1b3000c22a39101e966cf3b7406cf1af0ce15 /src/client/app/common/views/components | |
| parent | Fix error (diff) | |
| download | misskey-66409029e76949593a80063651f755f7d37d054e.tar.gz misskey-66409029e76949593a80063651f755f7d37d054e.tar.bz2 misskey-66409029e76949593a80063651f755f7d37d054e.zip | |
非ログイン時の警告処理 (#5219)
* Update note-mixin.ts
* Update note-mixin.ts
* :v:
* Update note-mixin.ts
* Update note-menu.vue
Diffstat (limited to 'src/client/app/common/views/components')
| -rw-r--r-- | src/client/app/common/views/components/note-menu.vue | 151 |
1 files changed, 87 insertions, 64 deletions
diff --git a/src/client/app/common/views/components/note-menu.vue b/src/client/app/common/views/components/note-menu.vue index 6e2b778b32..e76e1a0b11 100644 --- a/src/client/app/common/views/components/note-menu.vue +++ b/src/client/app/common/views/components/note-menu.vue @@ -22,72 +22,95 @@ export default Vue.extend({ }, computed: { items(): any[] { - return [{ - icon: 'at', - text: this.$t('mention'), - action: this.mention - }, null, { - icon: 'info-circle', - text: this.$t('detail'), - action: this.detail - }, { - icon: faCopy, - text: this.$t('copy-content'), - action: this.copyContent - }, { - icon: 'link', - text: this.$t('copy-link'), - action: this.copyLink - }, this.note.uri ? { - icon: 'external-link-square-alt', - text: this.$t('remote'), - action: () => { - window.open(this.note.uri, '_blank'); - } - } : undefined, - null, - this.isFavorited ? { - icon: 'star', - text: this.$t('unfavorite'), - action: () => this.toggleFavorite(false) - } : { - icon: 'star', - text: this.$t('favorite'), - action: () => this.toggleFavorite(true) - }, - this.note.userId != this.$store.state.i.id ? this.isWatching ? { - icon: faEyeSlash, - text: this.$t('unwatch'), - action: () => this.toggleWatch(false) - } : { - icon: faEye, - text: this.$t('watch'), - action: () => this.toggleWatch(true) - } : undefined, - this.note.userId == this.$store.state.i.id ? (this.$store.state.i.pinnedNoteIds || []).includes(this.note.id) ? { - icon: 'thumbtack', - text: this.$t('unpin'), - action: () => this.togglePin(false) - } : { - icon: 'thumbtack', - text: this.$t('pin'), - action: () => this.togglePin(true) - } : undefined, - ...(this.note.userId == this.$store.state.i.id || this.$store.state.i.isAdmin || this.$store.state.i.isModerator ? [ + if (this.$store.getters.isSignedIn) { + return [{ + icon: 'at', + text: this.$t('mention'), + action: this.mention + }, null, { + icon: 'info-circle', + text: this.$t('detail'), + action: this.detail + }, { + icon: faCopy, + text: this.$t('copy-content'), + action: this.copyContent + }, { + icon: 'link', + text: this.$t('copy-link'), + action: this.copyLink + }, this.note.uri ? { + icon: 'external-link-square-alt', + text: this.$t('remote'), + action: () => { + window.open(this.note.uri, '_blank'); + } + } : undefined, null, - this.note.userId == this.$store.state.i.id ? { - icon: 'undo-alt', - text: this.$t('delete-and-edit'), - action: this.deleteAndEdit + this.isFavorited ? { + icon: 'star', + text: this.$t('unfavorite'), + action: () => this.toggleFavorite(false) + } : { + icon: 'star', + text: this.$t('favorite'), + action: () => this.toggleFavorite(true) + }, + this.note.userId != this.$store.state.i.id ? this.isWatching ? { + icon: faEyeSlash, + text: this.$t('unwatch'), + action: () => this.toggleWatch(false) + } : { + icon: faEye, + text: this.$t('watch'), + action: () => this.toggleWatch(true) + } : undefined, + this.note.userId == this.$store.state.i.id ? (this.$store.state.i.pinnedNoteIds || []).includes(this.note.id) ? { + icon: 'thumbtack', + text: this.$t('unpin'), + action: () => this.togglePin(false) + } : { + icon: 'thumbtack', + text: this.$t('pin'), + action: () => this.togglePin(true) } : undefined, - { - icon: ['far', 'trash-alt'], - text: this.$t('delete'), - action: this.del - }] - : [] - )] - .filter(x => x !== undefined) + ...(this.note.userId == this.$store.state.i.id || this.$store.state.i.isAdmin || this.$store.state.i.isModerator ? [ + null, + this.note.userId == this.$store.state.i.id ? { + icon: 'undo-alt', + text: this.$t('delete-and-edit'), + action: this.deleteAndEdit + } : undefined, + { + icon: ['far', 'trash-alt'], + text: this.$t('delete'), + action: this.del + }] + : [] + )] + .filter(x => x !== undefined); + } else { + return [{ + icon: 'info-circle', + text: this.$t('detail'), + action: this.detail + }, { + icon: faCopy, + text: this.$t('copy-content'), + action: this.copyContent + }, { + icon: 'link', + text: this.$t('copy-link'), + action: this.copyLink + }, this.note.uri ? { + icon: 'external-link-square-alt', + text: this.$t('remote'), + action: () => { + window.open(this.note.uri, '_blank'); + } + } : undefined] + .filter(x => x !== undefined); + } } }, |