mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
check for whitespace in instance mutes.
This commit is contained in:
parent
c6e702c070
commit
77f0ba0ddf
1 changed files with 10 additions and 5 deletions
|
@ -22,6 +22,7 @@ import MkButton from '@/components/MkButton.vue';
|
||||||
import { ensureSignin } from '@/i.js';
|
import { ensureSignin } from '@/i.js';
|
||||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
|
import * as os from '@/os.js';
|
||||||
|
|
||||||
const $i = ensureSignin();
|
const $i = ensureSignin();
|
||||||
|
|
||||||
|
@ -35,13 +36,17 @@ const domainArray = computed(() => {
|
||||||
const changed = ref(false);
|
const changed = ref(false);
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
const mutes = instanceMutes.value
|
// checks for a full line without whitespace.
|
||||||
.trim().split('\n')
|
if (!domainArray.value.every(d => /^\S+$/.test(d))) {
|
||||||
.map(el => el.toLowerCase().trim())
|
os.alert({
|
||||||
.filter(el => el);
|
type: 'error',
|
||||||
|
title: i18n.ts.invalidValue,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await misskeyApi('i/update', {
|
await misskeyApi('i/update', {
|
||||||
mutedInstances: mutes,
|
mutedInstances: domainArray.value,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Refresh filtered list to signal to the user how they've been saved
|
// Refresh filtered list to signal to the user how they've been saved
|
||||||
|
|
Loading…
Add table
Reference in a new issue