diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-28 10:40:54 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-28 10:40:54 +0900 |
| commit | 076ac3b6140425991462ba4d94ea7b713ba83bf5 (patch) | |
| tree | 9d8f176a5b053e2e8647f428464aa3c7225b38a1 /src/client/app/common/scripts | |
| parent | Update CHANGELOG.md (diff) | |
| parent | 非ログイン時の警告処理 (#5219) (diff) | |
| download | misskey-076ac3b6140425991462ba4d94ea7b713ba83bf5.tar.gz misskey-076ac3b6140425991462ba4d94ea7b713ba83bf5.tar.bz2 misskey-076ac3b6140425991462ba4d94ea7b713ba83bf5.zip | |
Merge branch 'develop' of https://github.com/syuilo/misskey into develop
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/note-mixin.ts | 5 | ||||
| -rw-r--r-- | src/client/app/common/scripts/please-login.ts | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/client/app/common/scripts/note-mixin.ts b/src/client/app/common/scripts/note-mixin.ts index e649680070..fc82e78cec 100644 --- a/src/client/app/common/scripts/note-mixin.ts +++ b/src/client/app/common/scripts/note-mixin.ts @@ -3,6 +3,7 @@ import { sum, unique } from '../../../../prelude/array'; import shouldMuteNote from './should-mute-note'; import MkNoteMenu from '../views/components/note-menu.vue'; import MkReactionPicker from '../views/components/reaction-picker.vue'; +import pleaseLogin from './please-login'; function focus(el, fn) { const target = fn(el); @@ -108,6 +109,7 @@ export default (opts: Opts = {}) => ({ methods: { reply(viaKeyboard = false) { + pleaseLogin(this.$root); this.$root.$post({ reply: this.appearNote, animation: !viaKeyboard, @@ -118,6 +120,7 @@ export default (opts: Opts = {}) => ({ }, renote(viaKeyboard = false) { + pleaseLogin(this.$root); this.$root.$post({ renote: this.appearNote, animation: !viaKeyboard, @@ -134,6 +137,7 @@ export default (opts: Opts = {}) => ({ }, react(viaKeyboard = false) { + pleaseLogin(this.$root); this.blur(); this.$root.new(MkReactionPicker, { source: this.$refs.reactButton, @@ -159,6 +163,7 @@ export default (opts: Opts = {}) => ({ }, favorite() { + pleaseLogin(this.$root); this.$root.api('notes/favorites/create', { noteId: this.appearNote.id }).then(() => { diff --git a/src/client/app/common/scripts/please-login.ts b/src/client/app/common/scripts/please-login.ts new file mode 100644 index 0000000000..7125541bb1 --- /dev/null +++ b/src/client/app/common/scripts/please-login.ts @@ -0,0 +1,10 @@ +export default ($root: any) => { + if ($root.$store.getters.isSignedIn) return; + + $root.dialog({ + title: $root.$t('@.signin-required'), + text: null + }); + + throw new Error('signin required'); +}; |