This commit is contained in:
May 2023-03-02 07:45:07 -08:00
parent aa715fa868
commit 5ff88d917e
3 changed files with 30 additions and 3 deletions

View file

@ -65,7 +65,7 @@ export function userChange(optPicker) {
inputSettings: {}
},
{
name: "OK",
name: "Update username",
icon: "/static/assets/icons/update.svg",
description: "",
id: true
@ -97,7 +97,7 @@ export function pwdChng(optPicker) {
}
},
{
name: "OK",
name: "Update password",
icon: "/static/assets/icons/update.svg",
description: "This will log you out of all sessions",
id: true

View file

@ -36,3 +36,30 @@ export function dfv(optPicker) {
}
})
}
export function update_all_files(optPicker) {
optPicker.picker("You sure?",[
{
name: "Yeah",
icon: "/static/assets/icons/update.svg",
description: `This will make all of your files ${get(account).defaultFileVisibility || "public"}`,
id: true
}
]).then((exp) => {
if (exp && exp.selected) {
fetch(`/files/action`,{method:"POST", body:JSON.stringify({
target:get(account).files,
action: {
visibility: get(account).defaultFileVisibility
}
})}).then((response) => {
if (response.status != 200) {
optPicker.picker(`${response.status} ${response.statusText}`,[])
}
fetchAccountData()
})
}
})
}

View file

@ -146,7 +146,7 @@
<p>Default file visibility<span><br />Uploads will be <strong>{$account.defaultFileVisibility || "public"}</strong> by default</span></p>
</button>
<button>
<button on:click={() => uplOpts.update_all_files(optPicker)}>
<img src="/static/assets/icons/update.svg" alt="update">
<p>Make all of my files {$account.defaultFileVisibility || "public"}<span><br />Matches your default file visibility</p>
</button>