This commit is contained in:
split / 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: {} inputSettings: {}
}, },
{ {
name: "OK", name: "Update username",
icon: "/static/assets/icons/update.svg", icon: "/static/assets/icons/update.svg",
description: "", description: "",
id: true id: true
@ -97,7 +97,7 @@ export function pwdChng(optPicker) {
} }
}, },
{ {
name: "OK", name: "Update password",
icon: "/static/assets/icons/update.svg", icon: "/static/assets/icons/update.svg",
description: "This will log you out of all sessions", description: "This will log you out of all sessions",
id: true id: true

View file

@ -31,6 +31,33 @@ export function dfv(optPicker) {
optPicker.picker(`${response.status} ${response.statusText}`,[]) optPicker.picker(`${response.status} ${response.statusText}`,[])
} }
fetchAccountData()
})
}
})
}
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() 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> <p>Default file visibility<span><br />Uploads will be <strong>{$account.defaultFileVisibility || "public"}</strong> by default</span></p>
</button> </button>
<button> <button on:click={() => uplOpts.update_all_files(optPicker)}>
<img src="/static/assets/icons/update.svg" alt="update"> <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> <p>Make all of my files {$account.defaultFileVisibility || "public"}<span><br />Matches your default file visibility</p>
</button> </button>