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.

sync branch

Steven Tey986a480b754b
diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
index 39608a2c8a..3479acd8fa 100644
--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
@@ -153,11 +153,6 @@ const NAV_AREAS: SidebarNavAreas<{
icon: ConnectedDots,
href: `/${slug}/settings/integrations`,
},
- {
- name: "Security",
- icon: ShieldCheck,
- href: `/${slug}/settings/security`,
- },
...(programs?.length
? [
{
@@ -167,6 +162,11 @@ const NAV_AREAS: SidebarNavAreas<{
},
]
: []),
+ {
+ name: "Security",
+ icon: ShieldCheck,
+ href: `/${slug}/settings/security`,
+ },
...(flags?.referrals
? [
{
diff --git a/apps/web/ui/modals/deposit-funds-modal.tsx b/apps/web/ui/modals/deposit-funds-modal.tsx
index ff37f60292..fc399d0757 100644
--- a/apps/web/ui/modals/deposit-funds-modal.tsx
+++ b/apps/web/ui/modals/deposit-funds-modal.tsx
@@ -8,6 +8,7 @@ import { useAction } from "next-safe-action/hooks";
import { useCallback, useMemo, useState } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
+import { mutate } from "swr";
import { z } from "zod";
const DepositFunds = ({
@@ -34,7 +35,7 @@ const DepositFunds = ({
};
const DepositFundsForm = ({ closeModal }: { closeModal: () => void }) => {
- const { id: workspaceId, mutate } = useWorkspace();
+ const { id: workspaceId } = useWorkspace();
const {
register,
@@ -45,16 +46,19 @@ const DepositFundsForm = ({ closeModal }: { closeModal: () => void }) => {
mode: "onChange",
});
- const { executeAsync, isExecuting } = useAction(depositFundsAction, {
- async onSuccess() {
- toast.success("Funds deposited successfully.");
- mutate();
- closeModal();
+ const { executeAsync, isExecuting, hasSucceeded } = useAction(
+ depositFundsAction,
+ {
+ async onSuccess() {
+ await mutate(`/api/dots/transfers?workspaceId=${workspaceId}`);
+ closeModal();
+ toast.success("Funds deposited successfully.");
+ },
+ onError({ error }) {
+ toast.error(error.serverError?.serverError);
+ },
},
- onError({ error }) {
- toast.error(error.serverError?.serverError);
- },
- });
+ );
const onSubmit = async (data: z.infer<typeof depositFundsSchema>) => {
await executeAsync({ ...data, workspaceId: workspaceId! });
@@ -109,7 +113,7 @@ const DepositFundsForm = ({ closeModal }: { closeModal: () => void }) => {
text="Deposit funds"
className="h-9 w-fit"
disabled={!isValid}
- loading={isSubmitting || isExecuting}
+ loading={isSubmitting || isExecuting || hasSucceeded}
/>
</div>
</form>