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.

revert PostbackSecretModal changes

Steven Teyf15fb9903cfc
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/postbacks/[id]/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/postbacks/[id]/page-client.tsx
index 4b8addc180..57eb1c9c6e 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/postbacks/[id]/page-client.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/profile/postbacks/[id]/page-client.tsx
@@ -64,7 +64,7 @@ export function PostbackDetailPageClient({
return (
<>
{AddEditPostbackModal}
- <PostbackSecretModal />
+ {PostbackSecretModal}
{postbackEventDetailsSheet}
<PageContent
title="Postbacks"
diff --git a/apps/web/ui/postbacks/partner-postback-actions.tsx b/apps/web/ui/postbacks/partner-postback-actions.tsx
index 7f236824c0..da63062202 100644
--- a/apps/web/ui/postbacks/partner-postback-actions.tsx
+++ b/apps/web/ui/postbacks/partner-postback-actions.tsx
@@ -180,7 +180,7 @@ export function PostbackActions({
{enableConfirmModal}
{deleteConfirmModal}
{rollSecretConfirmModal}
- <PostbackSecretModal />
+ {PostbackSecretModal}
<SendTestPostbackModal
postbackId={postback.id}
triggers={postback.triggers}
diff --git a/apps/web/ui/postbacks/postback-secret-modal.tsx b/apps/web/ui/postbacks/postback-secret-modal.tsx
index 91216d0191..d43734b7e9 100644
--- a/apps/web/ui/postbacks/postback-secret-modal.tsx
+++ b/apps/web/ui/postbacks/postback-secret-modal.tsx
@@ -71,29 +71,6 @@ function PostbackSecretModal({
);
}
-interface PostbackSecretModalWrapperProps {
- state: { show: boolean; secret: string };
- closePostbackSecretModal: () => void;
-}
-
-function PostbackSecretModalWrapper({
- state,
- closePostbackSecretModal,
-}: PostbackSecretModalWrapperProps) {
- if (!state.show) return null;
-
- return (
- <PostbackSecretModal
- showModal={state.show}
- setShowModal={(show) => {
- const next = typeof show === "function" ? show(state.show) : show;
- if (!next) closePostbackSecretModal();
- }}
- secret={state.secret}
- />
- );
-}
-
export function usePostbackSecretModal() {
const [state, setState] = useState<{ show: boolean; secret: string }>({
show: false,
@@ -108,15 +85,25 @@ export function usePostbackSecretModal() {
setState({ show: false, secret: "" });
}
+ function PostbackSecretModalWrapper() {
+ if (!state.show) return null;
+
+ return (
+ <PostbackSecretModal
+ showModal={state.show}
+ setShowModal={(show) => {
+ const next = typeof show === "function" ? show(state.show) : show;
+ if (!next) closePostbackSecretModal();
+ }}
+ secret={state.secret}
+ />
+ );
+ }
+
return {
openPostbackSecretModal,
closePostbackSecretModal,
- PostbackSecretModal: (
- <PostbackSecretModalWrapper
- state={state}
- closePostbackSecretModal={closePostbackSecretModal}
- />
- ),
+ PostbackSecretModal: PostbackSecretModalWrapper,
isPostbackSecretModalOpen: state.show,
};
}