aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-10-04 09:43:26 -0700
committerAdam Soltys <[email protected]>2022-10-04 09:43:26 -0700
commit0e327470edcfa311ee50a25845e14aa32ece741b (patch)
tree2fbc5a4400220e35233812dfe6a511559cdf58df /src
parent81fc48aa58d932a19fb578e47170c06b3992d03a (diff)
downloadcoinos-ui-0e327470edcfa311ee50a25845e14aa32ece741b.tar.gz
coinos-ui-0e327470edcfa311ee50a25845e14aa32ece741b.zip
pass token to upload helper
Diffstat (limited to 'src')
-rw-r--r--src/lib/upload.js2
-rw-r--r--src/routes/[username]/settings/+page.svelte2
-rw-r--r--src/routes/[username]/settings/_account.svelte2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/upload.js b/src/lib/upload.js
index 4b03059c..099e2f30 100644
--- a/src/lib/upload.js
+++ b/src/lib/upload.js
@@ -13,7 +13,7 @@ export const upload = async (file, type, progress, token) => {
});
ajax.upload.addEventListener('progress', progress, false);
ajax.open('POST', url);
- ajax.setRequestHeader('Authorization', `Bearer ${get(token)}`);
+ ajax.setRequestHeader('Authorization', `Bearer ${token}`);
ajax.send(formData);
});
};
diff --git a/src/routes/[username]/settings/+page.svelte b/src/routes/[username]/settings/+page.svelte
index 91031e41..abad0ee7 100644
--- a/src/routes/[username]/settings/+page.svelte
+++ b/src/routes/[username]/settings/+page.svelte
@@ -28,7 +28,6 @@
let save = async () => {
try {
- console.log('Uploading files...');
if ($avatarUpload) {
await upload($avatarUpload.file, $avatarUpload.type, $avatarUpload.progress, token);
}
@@ -37,6 +36,7 @@
}
success('Settings saved');
} catch (e) {
+ console.log(e);
failure('Something went wrong');
}
};
diff --git a/src/routes/[username]/settings/_account.svelte b/src/routes/[username]/settings/_account.svelte
index 918a01bf..b6636129 100644
--- a/src/routes/[username]/settings/_account.svelte
+++ b/src/routes/[username]/settings/_account.svelte
@@ -127,6 +127,7 @@
<img
src={profile}
class="absolute w-full h-full object-cover object-center visible overflow-hidden"
+ alt={user.username}
/>
</div>
{:else if user.profile}
@@ -137,6 +138,7 @@
<img
src={`/api/public/${user.username}-profile.png`}
class="absolute w-full h-full object-cover object-center visible overflow-hidden"
+ alt={user.username}
/>
</div>
{:else}