aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/utils.js21
-rw-r--r--src/routes/(app)/[username]/payments/[...page]/+page.svelte2
2 files changed, 14 insertions, 9 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js
index 6902c928..a897bed8 100644
--- a/src/lib/utils.js
+++ b/src/lib/utils.js
@@ -42,7 +42,7 @@ export let get = (url, headers = {}) => {
};
export let post = async (url, body, headers) => {
- headers = {
+ headers = {
"content-type": "application/json",
accept: "application/json",
...headers,
@@ -185,13 +185,18 @@ export let fd = async (req) => {
return obj;
};
-export let f = (s, currency) =>
- new Intl.NumberFormat("en-US", {
- style: "currency",
- currency,
- })
- .format(s)
- .replace("CA", "");
+export let f = (s, currency) => {
+ try {
+ return new Intl.NumberFormat("en-US", {
+ style: "currency",
+ currency,
+ })
+ .format(s)
+ .replace("CA", "");
+ } catch (e) {
+ return "";
+ }
+};
export let s = (s) =>
new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(s);
diff --git a/src/routes/(app)/[username]/payments/[...page]/+page.svelte b/src/routes/(app)/[username]/payments/[...page]/+page.svelte
index 90f2ddbc..7e2bac9f 100644
--- a/src/routes/(app)/[username]/payments/[...page]/+page.svelte
+++ b/src/routes/(app)/[username]/payments/[...page]/+page.svelte
@@ -197,7 +197,7 @@
<div class="my-auto">
<Avatar user={p.with} size={16} disabled={true} />
</div>
- <div class="my-auto ml-1 text-secondary">
+ <div class="my-auto ml-1 text-secondary break-all">
{p.with.username}
</div>
</div>