Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

update pixel/link edit form on save.

Francis Caofbe031bfe990
diff --git a/src/app/(main)/links/LinkDeleteButton.tsx b/src/app/(main)/links/LinkDeleteButton.tsx
index 78f85f891..32ccbaf7e 100644
--- a/src/app/(main)/links/LinkDeleteButton.tsx
+++ b/src/app/(main)/links/LinkDeleteButton.tsx
@@ -1,5 +1,5 @@
import { ConfirmationForm } from '@/components/common/ConfirmationForm';
-import { useDeleteQuery, useMessages } from '@/components/hooks';
+import { useDeleteQuery, useMessages, useModified } from '@/components/hooks';
import { Trash } from '@/components/icons';
import { DialogButton } from '@/components/input/DialogButton';
import { messages } from '@/components/messages';
@@ -15,7 +15,8 @@ export function LinkDeleteButton({
onSave?: () => void;
}) {
const { formatMessage, labels, getErrorMessage, FormattedMessage } = useMessages();
- const { mutateAsync, isPending, error, touch } = useDeleteQuery(`/links/${linkId}`);
+ const { mutateAsync, isPending, error } = useDeleteQuery(`/links/${linkId}`);
+ const { touch } = useModified();
const handleConfirm = async (close: () => void) => {
await mutateAsync(null, {
diff --git a/src/app/(main)/links/LinkEditForm.tsx b/src/app/(main)/links/LinkEditForm.tsx
index e9ad18f4f..a6c0164d0 100644
--- a/src/app/(main)/links/LinkEditForm.tsx
+++ b/src/app/(main)/links/LinkEditForm.tsx
@@ -50,6 +50,7 @@ export function LinkEditForm({
onSuccess: async () => {
toast(formatMessage(messages.saved));
touch('links');
+ touch(`link:${linkId}`);
onSave?.();
onClose?.();
},
diff --git a/src/app/(main)/pixels/PixelEditForm.tsx b/src/app/(main)/pixels/PixelEditForm.tsx
index aedd3a3b6..46241c1cf 100644
--- a/src/app/(main)/pixels/PixelEditForm.tsx
+++ b/src/app/(main)/pixels/PixelEditForm.tsx
@@ -48,6 +48,7 @@ export function PixelEditForm({
onSuccess: async () => {
toast(formatMessage(messages.saved));
touch('pixels');
+ touch(`pixel:${pixelId}`);
onSave?.();
onClose?.();
},