diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2021-04-26 13:00:10 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2021-04-26 13:00:10 +0900 |
| commit | 17fff8c66525d62721bd1fa29d11360908904ec3 (patch) | |
| tree | 4f22894599833ba4ef7f5b15da0bc1571cc66eb8 /src/client/components | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.79.2 (diff) | |
| download | misskey-17fff8c66525d62721bd1fa29d11360908904ec3.tar.gz misskey-17fff8c66525d62721bd1fa29d11360908904ec3.tar.bz2 misskey-17fff8c66525d62721bd1fa29d11360908904ec3.zip | |
Merge branch 'develop'
Diffstat (limited to 'src/client/components')
| -rw-r--r-- | src/client/components/captcha.vue | 26 | ||||
| -rw-r--r-- | src/client/components/drive.file.vue | 2 | ||||
| -rw-r--r-- | src/client/components/drive.folder.vue | 2 | ||||
| -rw-r--r-- | src/client/components/drive.vue | 2 | ||||
| -rw-r--r-- | src/client/components/post-form-attaches.vue | 2 |
5 files changed, 20 insertions, 14 deletions
diff --git a/src/client/components/captcha.vue b/src/client/components/captcha.vue index 26215df09d..5da8ede3b9 100644 --- a/src/client/components/captcha.vue +++ b/src/client/components/captcha.vue @@ -6,7 +6,7 @@ </template> <script lang="ts"> -import { defineComponent } from 'vue'; +import { defineComponent, PropType } from 'vue'; type Captcha = { render(container: string | Node, options: { @@ -32,7 +32,7 @@ declare global { export default defineComponent({ props: { provider: { - type: String, + type: String as PropType<CaptchaProvider>, required: true, }, sitekey: { @@ -51,19 +51,25 @@ export default defineComponent({ }, computed: { - loaded() { - return !!window[this.provider as CaptchaProvider]; + variable(): string { + switch (this.provider) { + case 'hcaptcha': return 'hcaptcha'; + case 'recaptcha': return 'grecaptcha'; + } + }, + loaded(): boolean { + return !!window[this.variable]; }, - src() { + src(): string { const endpoint = ({ hcaptcha: 'https://hcaptcha.com/1', recaptcha: 'https://www.recaptcha.net/recaptcha', - } as Record<PropertyKey, unknown>)[this.provider]; + } as Record<CaptchaProvider, string>)[this.provider]; - return `${typeof endpoint == 'string' ? endpoint : 'about:invalid'}/api.js?render=explicit`; + return `${typeof endpoint === 'string' ? endpoint : 'about:invalid'}/api.js?render=explicit`; }, - captcha() { - return window[this.provider as CaptchaProvider] || {} as unknown as Captcha; + captcha(): Captcha { + return window[this.variable] || {} as unknown as Captcha; }, }, @@ -94,7 +100,7 @@ export default defineComponent({ methods: { reset() { - this.captcha?.reset(); + if (this.captcha?.reset) this.captcha.reset(); }, requestRender() { if (this.captcha.render && this.$refs.captcha instanceof Element) { diff --git a/src/client/components/drive.file.vue b/src/client/components/drive.file.vue index 293465e428..37b1afc1b3 100644 --- a/src/client/components/drive.file.vue +++ b/src/client/components/drive.file.vue @@ -81,7 +81,7 @@ export default defineComponent({ getMenu() { return [{ text: this.$ts.rename, - icon: faICursor, + icon: 'fas fa-i-cursor', action: this.rename }, { text: this.file.isSensitive ? this.$ts.unmarkAsSensitive : this.$ts.markAsSensitive, diff --git a/src/client/components/drive.folder.vue b/src/client/components/drive.folder.vue index 6ddd392527..4c09e7775a 100644 --- a/src/client/components/drive.folder.vue +++ b/src/client/components/drive.folder.vue @@ -247,7 +247,7 @@ export default defineComponent({ } }, null, { text: this.$ts.rename, - icon: faICursor, + icon: 'fas fa-i-cursor', action: this.rename }, null, { text: this.$ts.delete, diff --git a/src/client/components/drive.vue b/src/client/components/drive.vue index bd5bd8008b..06f9cf7806 100644 --- a/src/client/components/drive.vue +++ b/src/client/components/drive.vue @@ -614,7 +614,7 @@ export default defineComponent({ type: 'label' }, this.folder ? { text: this.$ts.renameFolder, - icon: faICursor, + icon: 'fas fa-i-cursor', action: () => { this.renameFolder(this.folder); } } : undefined, this.folder ? { text: this.$ts.deleteFolder, diff --git a/src/client/components/post-form-attaches.vue b/src/client/components/post-form-attaches.vue index eba7e7af36..f832ea87b5 100644 --- a/src/client/components/post-form-attaches.vue +++ b/src/client/components/post-form-attaches.vue @@ -93,7 +93,7 @@ export default defineComponent({ if (this.menu) return; this.menu = os.modalMenu([{ text: this.$ts.renameFile, - icon: faICursor, + icon: 'fas fa-i-cursor', action: () => { this.rename(file) } }, { text: file.isSensitive ? this.$ts.unmarkAsSensitive : this.$ts.markAsSensitive, |