Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix: minor tweaks after self-review

unrenamed0ef0d77fe033
diff --git a/apps/web/ui/modals/link-builder/index.tsx b/apps/web/ui/modals/link-builder/index.tsx
index 21b443fa63..69ff9cb528 100644
--- a/apps/web/ui/modals/link-builder/index.tsx
+++ b/apps/web/ui/modals/link-builder/index.tsx
@@ -294,11 +294,12 @@ function LinkBuilderInner({
// copy shortlink to clipboard when adding a new link
if (!props) {
- toast.promise(copyToClipboard(data.shortLink), {
- success: "Copied short link to clipboard!",
- error: (e) => `Failed to copy to clipboard: ${e}`,
- });
- toast.success("Successfully created link!");
+ try {
+ await copyToClipboard(data.shortLink);
+ toast.success("Copied short link to clipboard!");
+ } catch (err) {
+ toast.success("Successfully created link!");
+ }
} else toast.success("Successfully updated short link!");
draftControlsRef.current?.onSubmitSuccessful();
diff --git a/apps/web/ui/modals/scim-modal.tsx b/apps/web/ui/modals/scim-modal.tsx
index 9f913e8856..a4d9d6f7d6 100644
--- a/apps/web/ui/modals/scim-modal.tsx
+++ b/apps/web/ui/modals/scim-modal.tsx
@@ -226,7 +226,7 @@ function SCIMModal({
<button
type="button"
onClick={() => {
- const token = `${scim.directories[0].scim.secret}`;
+ const token = scim.directories[0].scim.secret as string;
toast.promise(copyBearerTokenToClipboard(token), {
success: "Copied to clipboard",
});
diff --git a/packages/ui/src/nav-logo.tsx b/packages/ui/src/nav-logo.tsx
index 3acec1f230..2314914485 100644
--- a/packages/ui/src/nav-logo.tsx
+++ b/packages/ui/src/nav-logo.tsx
@@ -46,10 +46,10 @@ export function NavLogo({
const [, copyToClipboard] = useCopyToClipboard();
- async function copy(text: string) {
+ function copy(text: string) {
toast.promise(copyToClipboard(text), {
success: "Copied to clipboard!",
- error: "Failed to copy to clipboard.",
+ error: "Failed to copy to clipboard",
});
}