From 818a9584e4c385ec841d97beff7dee37369d40c8 Mon Sep 17 00:00:00 2001 From: Derick M <58572875+TurtIeSocks@users.noreply.github.com> Date: Mon, 29 Jan 2024 15:22:02 -0500 Subject: [PATCH] fix: uid for editing --- src/components/layout/dialogs/webhooks/WebhookAdv.jsx | 8 +++++++- src/components/layout/dialogs/webhooks/store.js | 2 ++ .../layout/dialogs/webhooks/tiles/TrackedTile.jsx | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/layout/dialogs/webhooks/WebhookAdv.jsx b/src/components/layout/dialogs/webhooks/WebhookAdv.jsx index 82ce2cfb7..810d4b4a9 100644 --- a/src/components/layout/dialogs/webhooks/WebhookAdv.jsx +++ b/src/components/layout/dialogs/webhooks/WebhookAdv.jsx @@ -818,7 +818,13 @@ export default function WebhookAdvanced() { } if (onClose) onClose(poracleValues, realSave) useWebhookStore.setState((prev) => ({ - advanced: { ...prev.advanced, open: false, selectedIds: [] }, + advanced: { + ...prev.advanced, + id: '', + uid: 0, + open: false, + selectedIds: [], + }, })) } diff --git a/src/components/layout/dialogs/webhooks/store.js b/src/components/layout/dialogs/webhooks/store.js index 6b46dee95..0ce833b0d 100644 --- a/src/components/layout/dialogs/webhooks/store.js +++ b/src/components/layout/dialogs/webhooks/store.js @@ -31,6 +31,7 @@ import { create } from 'zustand' * tempFilters: Record * advanced: { * id: string + * uid: number * category: string * selectedIds: string[] * open: boolean @@ -73,6 +74,7 @@ export const useWebhookStore = create(() => ({ tempFilters: {}, advanced: { id: '', + uid: 0, category: '', selectedIds: [], open: false, diff --git a/src/components/layout/dialogs/webhooks/tiles/TrackedTile.jsx b/src/components/layout/dialogs/webhooks/tiles/TrackedTile.jsx index 0683e75d7..f2119d45e 100644 --- a/src/components/layout/dialogs/webhooks/tiles/TrackedTile.jsx +++ b/src/components/layout/dialogs/webhooks/tiles/TrackedTile.jsx @@ -24,7 +24,7 @@ export default function TrackedTile({ index }) { const defaults = useWebhookStore((s) => s.context.ui[category].defaults) React.useEffect(() => { - if (advOpen.open && advOpen.id === id) { + if (advOpen.open && advOpen.id === id && advOpen.uid === item.uid) { useWebhookStore.setState((prev) => ({ tempFilters: { ...prev.tempFilters, @@ -82,6 +82,7 @@ export default function TrackedTile({ index }) { advanced: { open: true, id, + uid: item.uid, category, selectedIds: [], onClose,