Skip to content

Commit

Permalink
fix: uid for editing
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Jan 29, 2024
1 parent 99cf89b commit 818a958
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/layout/dialogs/webhooks/WebhookAdv.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
},
}))
}

Expand Down
2 changes: 2 additions & 0 deletions src/components/layout/dialogs/webhooks/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { create } from 'zustand'
* tempFilters: Record<string, any>
* advanced: {
* id: string
* uid: number
* category: string
* selectedIds: string[]
* open: boolean
Expand Down Expand Up @@ -73,6 +74,7 @@ export const useWebhookStore = create(() => ({
tempFilters: {},
advanced: {
id: '',
uid: 0,
category: '',
selectedIds: [],
open: false,
Expand Down
3 changes: 2 additions & 1 deletion src/components/layout/dialogs/webhooks/tiles/TrackedTile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -82,6 +82,7 @@ export default function TrackedTile({ index }) {
advanced: {
open: true,
id,
uid: item.uid,
category,
selectedIds: [],
onClose,
Expand Down

0 comments on commit 818a958

Please sign in to comment.