diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-05 18:02:42 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-05 18:02:42 +0900 |
| commit | 3c5324bbbb6982d419db76640b46341c3e088543 (patch) | |
| tree | 534e73fa6f604e726a38f7947663e0899fb0eb05 /src/client | |
| parent | Merge branch 'develop' (diff) | |
| parent | 11.24.1 (diff) | |
| download | sharkey-3c5324bbbb6982d419db76640b46341c3e088543.tar.gz sharkey-3c5324bbbb6982d419db76640b46341c3e088543.tar.bz2 sharkey-3c5324bbbb6982d419db76640b46341c3e088543.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/common/views/components/emoji.vue | 16 | ||||
| -rw-r--r-- | src/client/app/common/views/components/reaction-icon.vue | 7 | ||||
| -rw-r--r-- | src/client/app/common/views/components/signin.vue | 16 |
3 files changed, 32 insertions, 7 deletions
diff --git a/src/client/app/common/views/components/emoji.vue b/src/client/app/common/views/components/emoji.vue index 0cc78a337b..20c1ea1a80 100644 --- a/src/client/app/common/views/components/emoji.vue +++ b/src/client/app/common/views/components/emoji.vue @@ -55,6 +55,20 @@ export default Vue.extend({ } }, + watch: { + customEmojis() { + if (this.name) { + const customEmoji = this.customEmojis.find(x => x.name == this.name); + if (customEmoji) { + this.customEmoji = customEmoji; + this.url = this.$store.state.device.disableShowingAnimatedImages + ? getStaticImageUrl(customEmoji.url) + : customEmoji.url; + } + } + }, + }, + created() { if (this.name) { const customEmoji = this.customEmojis.find(x => x.name == this.name); @@ -80,7 +94,7 @@ export default Vue.extend({ this.url = `${twemojiBase}/2/svg/${codes.join('-')}.svg`; } - } + }, }); </script> diff --git a/src/client/app/common/views/components/reaction-icon.vue b/src/client/app/common/views/components/reaction-icon.vue index 022d57dc44..afe51d7833 100644 --- a/src/client/app/common/views/components/reaction-icon.vue +++ b/src/client/app/common/views/components/reaction-icon.vue @@ -15,9 +15,14 @@ export default Vue.extend({ }, data() { return { - customEmojis: (this.$root.getMetaSync() || { emojis: [] }).emojis || [] + customEmojis: [] }; }, + created() { + this.$root.getMeta().then(meta => { + if (meta && meta.emojis) this.customEmojis = meta.emojis; + }); + }, computed: { str(): any { switch (this.reaction) { diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue index 53cc62c333..8498a1dc3e 100644 --- a/src/client/app/common/views/components/signin.vue +++ b/src/client/app/common/views/components/signin.vue @@ -107,9 +107,8 @@ export default Vue.extend({ })), timeout: 60 * 1000 } - }).catch(err => { + }).catch(() => { this.queryingKey = false; - console.warn(err); return Promise.reject(null); }).then(credential => { this.queryingKey = false; @@ -127,8 +126,7 @@ export default Vue.extend({ localStorage.setItem('i', res.i); location.reload(); }).catch(err => { - if(err === null) return; - console.error(err); + if (err === null) return; this.$root.dialog({ type: 'error', text: this.$t('login-failed') @@ -142,7 +140,7 @@ export default Vue.extend({ if (!this.totpLogin && this.user && this.user.twoFactorEnabled) { if (window.PublicKeyCredential && this.user.securityKeys) { - this.$root.api('i/2fa/getkeys', { + this.$root.api('signin', { username: this.username, password: this.password }).then(res => { @@ -150,6 +148,14 @@ export default Vue.extend({ this.signing = false; this.challengeData = res; return this.queryKey(); + }).catch(() => { + this.$root.dialog({ + type: 'error', + text: this.$t('login-failed') + }); + this.challengeData = null; + this.totpLogin = false; + this.signing = false; }); } else { this.totpLogin = true; |