mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
improve attributionDomains setting.
This commit is contained in:
parent
5545ddf9dd
commit
752d6a77f6
1 changed files with 9 additions and 3 deletions
|
@ -34,12 +34,13 @@ const $i = ensureSignin();
|
||||||
|
|
||||||
const attributionDomains = ref($i.attributionDomains.join('\n'));
|
const attributionDomains = ref($i.attributionDomains.join('\n'));
|
||||||
const changed = ref(false);
|
const changed = ref(false);
|
||||||
|
const autochange = ref(false);
|
||||||
const tutorialTag = '`<meta name="fediverse:creator" content="' + $i.username + '@' + toUnicode(hostRaw) + '" />`';
|
const tutorialTag = '`<meta name="fediverse:creator" content="' + $i.username + '@' + toUnicode(hostRaw) + '" />`';
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
let domains = attributionDomains.value
|
let domains = attributionDomains.value
|
||||||
.trim().split('\n')
|
.trim().split('\n')
|
||||||
.map(el => el.trim())
|
.map(el => el.trim().toLowerCase())
|
||||||
.filter(el => el);
|
.filter(el => el);
|
||||||
|
|
||||||
await misskeyApi('i/update', {
|
await misskeyApi('i/update', {
|
||||||
|
@ -49,10 +50,15 @@ async function save() {
|
||||||
changed.value = false;
|
changed.value = false;
|
||||||
|
|
||||||
// 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
|
||||||
attributionDomains.value = domains.join('\n');
|
if (attributionDomains.value !== domains.join('\n')) {
|
||||||
|
attributionDomains.value = domains.join('\n');
|
||||||
|
autochange.value = true;
|
||||||
|
} else { autochange.value = false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(attributionDomains, () => {
|
watch(attributionDomains, () => {
|
||||||
changed.value = true;
|
if (!autochange.value) {
|
||||||
|
changed.value = true;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue