Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop

This commit is contained in:
syuilo 2022-01-21 18:27:37 +09:00
commit 43baafbebb
2 changed files with 8 additions and 8 deletions

View File

@ -55,12 +55,10 @@ const variable = computed(() => {
const loaded = computed(() => !!window[variable.value]); const loaded = computed(() => !!window[variable.value]);
const src = computed(() => { const src = computed(() => {
const endpoint = ({ switch (props.provider) {
hcaptcha: 'https://hcaptcha.com/1', case 'hcaptcha': return 'https://js.hcaptcha.com/1/api.js?render=explicit&recaptchacompat=off';
recaptcha: 'https://www.recaptcha.net/recaptcha', case 'recaptcha': return 'https://www.recaptcha.net/recaptcha/api.js?render=explicit';
} as Record<CaptchaProvider, string>)[props.provider]; }
return `${typeof endpoint === 'string' ? endpoint : 'about:invalid'}/api.js?render=explicit`;
}); });
const captcha = computed<Captcha>(() => window[variable.value] || {} as unknown as Captcha); const captcha = computed<Captcha>(() => window[variable.value] || {} as unknown as Captcha);

View File

@ -98,10 +98,12 @@ export default defineComponent({
}, { }, {
done: result => { done: result => {
if (!result || result.canceled) return; if (!result || result.canceled) return;
let comment = result.result; let comment = result.result.length == 0 ? null : result.result;
os.api('drive/files/update', { os.api('drive/files/update', {
fileId: file.id, fileId: file.id,
comment: comment.length == 0 ? null : comment comment: comment,
}).then(() => {
file.comment = comment;
}); });
} }
}, 'closed'); }, 'closed');