bug: avatar uploads

This commit is contained in:
Kieran 2023-01-30 19:36:55 +00:00
parent 0a6339ddf1
commit 462fc60dfe
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -78,8 +78,9 @@ export default function ProfileSettings() {
if (file) {
console.log(file);
let rsp = await uploader.upload(file, file.name);
if (!rsp?.error) {
throw new Error("Upload failed, please try again later");
console.log(rsp);
if (typeof rsp?.error === "string") {
throw new Error(`Upload failed ${rsp.error}`);
}
return rsp.url;
}