mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-17 17:35:17 +00:00
Merge pull request #3867 from karyanayandi/fix/lazy-initializer-for-usestate
fix: use lazy initializer for useState with function calls
(cherry picked from commit 27377da6fa)
[skip ci]
This commit is contained in:
committed by
Dokploy Bot
parent
6ec530043e
commit
54272b95b6
@@ -63,7 +63,7 @@ export const ShowRequests = () => {
|
|||||||
const [dateRange, setDateRange] = useState<{
|
const [dateRange, setDateRange] = useState<{
|
||||||
from: Date | undefined;
|
from: Date | undefined;
|
||||||
to: Date | undefined;
|
to: Date | undefined;
|
||||||
}>(getDefaultDateRange());
|
}>(() => getDefaultDateRange());
|
||||||
|
|
||||||
// Check if logs exist to determine if traefik has been reloaded
|
// Check if logs exist to determine if traefik has been reloaded
|
||||||
// Only fetch when active to minimize network calls
|
// Only fetch when active to minimize network calls
|
||||||
|
|||||||
@@ -32,7 +32,9 @@ export const TerminalModal = ({
|
|||||||
serverId,
|
serverId,
|
||||||
asButton = false,
|
asButton = false,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const [terminalKey, setTerminalKey] = useState<string>(getTerminalKey());
|
const [terminalKey, setTerminalKey] = useState<string>(() =>
|
||||||
|
getTerminalKey(),
|
||||||
|
);
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const isLocalServer = serverId === "local";
|
const isLocalServer = serverId === "local";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user