mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 09:31:55 +08:00
fix(toast): only once
This commit is contained in:
parent
ddebfc9c96
commit
a2aaacb348
@ -13,7 +13,7 @@ function Header() {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { data: settingData,isLoading } = useQuery({
|
||||
const { data: settingData, isLoading } = useQuery({
|
||||
queryKey: ["setting"],
|
||||
queryFn: () => fetchSetting(),
|
||||
refetchOnMount: true,
|
||||
|
@ -46,8 +46,10 @@ export default function Servers() {
|
||||
];
|
||||
|
||||
useEffect(() => {
|
||||
if (readyState == 1) {
|
||||
const hasShownToast = sessionStorage.getItem("websocket-connected-toast");
|
||||
if (readyState == 1 && !hasShownToast) {
|
||||
toast.success(t("info.websocketConnected"));
|
||||
sessionStorage.setItem("websocket-connected-toast", "true");
|
||||
}
|
||||
}, [readyState]);
|
||||
|
||||
|
@ -150,7 +150,6 @@ export interface CycleTransferData {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
export interface SettingResponse {
|
||||
success: boolean;
|
||||
data: {
|
||||
@ -158,4 +157,4 @@ export interface SettingResponse {
|
||||
site_name: string;
|
||||
custom_code: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user