fix config pusher (#127)

* fix config pusher

* chore: auto-fix linting and formatting issues
This commit is contained in:
UUBulb
2025-03-25 22:40:56 +08:00
committed by GitHub
parent f85cc2fde3
commit f5c8131a2c
2 changed files with 6 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
"use client" "use client"
import { useState } from "react" import { useEffect, useState } from "react"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
import { Label } from "../ui/label" import { Label } from "../ui/label"
@@ -16,6 +16,10 @@ export const Pusher: React.FC<PusherProps> = ({ property, setData }) => {
const [cData, setCData] = useState<Record<string, any>>({}) const [cData, setCData] = useState<Record<string, any>>({})
const { t } = useTranslation() const { t } = useTranslation()
useEffect(() => {
setData(cData)
}, [cData, setData])
return ( return (
<div className="flex flex-col gap-3"> <div className="flex flex-col gap-3">
<div className="flex gap-2 ml-auto"> <div className="flex gap-2 ml-auto">
@@ -27,7 +31,6 @@ export const Pusher: React.FC<PusherProps> = ({ property, setData }) => {
const temp = { ...cData } const temp = { ...cData }
temp[k] = JSON.parse(v) temp[k] = JSON.parse(v)
setCData(temp) setCData(temp)
setData(cData)
} }
}} }}
/> />
@@ -40,7 +43,6 @@ export const Pusher: React.FC<PusherProps> = ({ property, setData }) => {
const temp = { ...cData } const temp = { ...cData }
temp[k] = undefined temp[k] = undefined
setCData(temp) setCData(temp)
setData(cData)
} }
}} }}
/> />

View File

@@ -12,7 +12,7 @@ const resources = {
"en-US": { "en-US": {
translation: enTranslation, translation: enTranslation,
}, },
'it-IT': { "it-IT": {
translation: itTranslation, translation: itTranslation,
}, },
"ru-RU": { "ru-RU": {