Skip to content

Commit f5c8131

Browse files
authored
fix config pusher (#127)
* fix config pusher * chore: auto-fix linting and formatting issues
1 parent f85cc2f commit f5c8131

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/components/xui/pusher.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client"
22

3-
import { useState } from "react"
3+
import { useEffect, useState } from "react"
44
import { useTranslation } from "react-i18next"
55

66
import { Label } from "../ui/label"
@@ -16,6 +16,10 @@ export const Pusher: React.FC<PusherProps> = ({ property, setData }) => {
1616
const [cData, setCData] = useState<Record<string, any>>({})
1717
const { t } = useTranslation()
1818

19+
useEffect(() => {
20+
setData(cData)
21+
}, [cData, setData])
22+
1923
return (
2024
<div className="flex flex-col gap-3">
2125
<div className="flex gap-2 ml-auto">
@@ -27,7 +31,6 @@ export const Pusher: React.FC<PusherProps> = ({ property, setData }) => {
2731
const temp = { ...cData }
2832
temp[k] = JSON.parse(v)
2933
setCData(temp)
30-
setData(cData)
3134
}
3235
}}
3336
/>
@@ -40,7 +43,6 @@ export const Pusher: React.FC<PusherProps> = ({ property, setData }) => {
4043
const temp = { ...cData }
4144
temp[k] = undefined
4245
setCData(temp)
43-
setData(cData)
4446
}
4547
}}
4648
/>

src/lib/i18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const resources = {
1212
"en-US": {
1313
translation: enTranslation,
1414
},
15-
'it-IT': {
15+
"it-IT": {
1616
translation: itTranslation,
1717
},
1818
"ru-RU": {

0 commit comments

Comments
 (0)