diff options
| author | piuvas <mail@piuvas.net> | 2025-06-02 22:50:09 -0300 |
|---|---|---|
| committer | piuvas <mail@piuvas.net> | 2025-06-02 22:50:09 -0300 |
| commit | c6e702c0709e71ab2e03eb106cd1064d59e3dc23 (patch) | |
| tree | bf5ce6994e4e6e1a574760959be909d427d968b2 | |
| parent | improve instanceMute setting. (diff) | |
| download | sharkey-c6e702c0709e71ab2e03eb106cd1064d59e3dc23.tar.gz sharkey-c6e702c0709e71ab2e03eb106cd1064d59e3dc23.tar.bz2 sharkey-c6e702c0709e71ab2e03eb106cd1064d59e3dc23.zip | |
check for whitespace in attribution domains.
| -rw-r--r-- | packages/frontend/src/pages/settings/profile.attribution-domains-setting.vue | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/frontend/src/pages/settings/profile.attribution-domains-setting.vue b/packages/frontend/src/pages/settings/profile.attribution-domains-setting.vue index 683bf9f8f5..c77870f9d3 100644 --- a/packages/frontend/src/pages/settings/profile.attribution-domains-setting.vue +++ b/packages/frontend/src/pages/settings/profile.attribution-domains-setting.vue @@ -20,11 +20,11 @@ import { ref, watch, computed } from 'vue'; import { host as hostRaw } from '@@/js/config.js'; import { toUnicode } from 'punycode.js'; import MkTextarea from '@/components/MkTextarea.vue'; -import MkInfo from '@/components/MkInfo.vue'; import MkButton from '@/components/MkButton.vue'; import { ensureSignin } from '@/i.js'; import { misskeyApi } from '@/utility/misskey-api.js'; import { i18n } from '@/i18n.js'; +import * as os from '@/os.js'; const $i = ensureSignin(); @@ -39,6 +39,15 @@ const changed = ref(false); const tutorialTag = '`<meta name="fediverse:creator" content="' + $i.username + '@' + toUnicode(hostRaw) + '" />`'; async function save() { + // checks for a full line without whitespace. + if (!domainArray.value.every(d => /^\S+$/.test(d))) { + os.alert({ + type: 'error', + title: i18n.ts.invalidValue, + }); + return; + } + await misskeyApi('i/update', { attributionDomains: domainArray.value, }); |