fix(dashboard): don't overwrite current privacy settings
This commit is contained in:
parent
0046ca6859
commit
c8e8655b4f
@ -12,19 +12,16 @@
|
|||||||
let err: string;
|
let err: string;
|
||||||
let loading = false;
|
let loading = false;
|
||||||
|
|
||||||
let allPrivacy: string;
|
function changePrivacy(e: Event) {
|
||||||
|
const target = e.target as HTMLInputElement;
|
||||||
$: { changePrivacy(allPrivacy)}
|
let value = target.value;
|
||||||
|
|
||||||
function changePrivacy(value: string) {
|
|
||||||
if (value) {
|
|
||||||
input.privacy.description_privacy = value;
|
input.privacy.description_privacy = value;
|
||||||
input.privacy.list_privacy = value;
|
input.privacy.list_privacy = value;
|
||||||
input.privacy.visibility = value;
|
input.privacy.visibility = value;
|
||||||
input.privacy.icon_privacy = value;
|
input.privacy.icon_privacy = value;
|
||||||
input.privacy.name_privacy = value;
|
input.privacy.name_privacy = value;
|
||||||
input.privacy.metadata_privacy = value;
|
input.privacy.metadata_privacy = value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
@ -65,7 +62,7 @@
|
|||||||
<Alert color="danger">{err}</Alert>
|
<Alert color="danger">{err}</Alert>
|
||||||
{/if}
|
{/if}
|
||||||
<Label><b>Set all to:</b></Label>
|
<Label><b>Set all to:</b></Label>
|
||||||
<select class="form-select" bind:value={allPrivacy} use:focus aria-label="set all to">
|
<select class="form-select" on:change={(e) => changePrivacy(e)} use:focus aria-label="set all to">
|
||||||
<option>public</option>
|
<option>public</option>
|
||||||
<option>private</option>
|
<option>private</option>
|
||||||
</select>
|
</select>
|
||||||
|
@ -12,12 +12,10 @@
|
|||||||
|
|
||||||
let err: string;
|
let err: string;
|
||||||
|
|
||||||
let allPrivacy: string;
|
function changePrivacy(e: Event) {
|
||||||
|
const target = e.target as HTMLInputElement;
|
||||||
$: { changePrivacy(allPrivacy)}
|
let value = target.value;
|
||||||
|
|
||||||
function changePrivacy(value: string) {
|
|
||||||
if (value) {
|
|
||||||
input.privacy.description_privacy = value;
|
input.privacy.description_privacy = value;
|
||||||
input.privacy.name_privacy = value;
|
input.privacy.name_privacy = value;
|
||||||
input.privacy.avatar_privacy = value;
|
input.privacy.avatar_privacy = value;
|
||||||
@ -25,7 +23,6 @@
|
|||||||
input.privacy.pronoun_privacy = value;
|
input.privacy.pronoun_privacy = value;
|
||||||
input.privacy.visibility = value;
|
input.privacy.visibility = value;
|
||||||
input.privacy.metadata_privacy = value;
|
input.privacy.metadata_privacy = value;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
@ -35,6 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
let input: Member = {privacy: member.privacy};
|
let input: Member = {privacy: member.privacy};
|
||||||
|
console.log(member.privacy);
|
||||||
|
|
||||||
async function submit() {
|
async function submit() {
|
||||||
let data = input;
|
let data = input;
|
||||||
@ -67,7 +65,7 @@
|
|||||||
<Alert color="danger">{err}</Alert>
|
<Alert color="danger">{err}</Alert>
|
||||||
{/if}
|
{/if}
|
||||||
<Label><b>Set all to:</b></Label>
|
<Label><b>Set all to:</b></Label>
|
||||||
<select class="form-select" bind:value={allPrivacy} use:focus aria-label="set all to">
|
<select class="form-select" on:change={(e) => changePrivacy(e)} use:focus aria-label="set all to">
|
||||||
<option>public</option>
|
<option>public</option>
|
||||||
<option>private</option>
|
<option>private</option>
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user