diff --git a/app/(main)/firewall/page.tsx b/app/(main)/firewall/page.tsx index c93282a4..c6b0b011 100644 --- a/app/(main)/firewall/page.tsx +++ b/app/(main)/firewall/page.tsx @@ -2025,7 +2025,9 @@ function FirewallPageInner() { }, [isLive, historyServerId, apiFetch]) const restoreRevision = useCallback(async (id: string) => { - if (!isLive || !historyServerId) return + if (!isLive || !historyServerId) throw new Error("Выберите устройство в режиме Live") + if (mutationLock.current) throw new Error("Дождитесь завершения текущей операции Firewall") + mutationLock.current = true setHistoryRestoring(true) try { const res = await apiFetch<{ ok: boolean }>( @@ -2039,6 +2041,7 @@ function FirewallPageInner() { } catch (err) { throw err } finally { + mutationLock.current = false setHistoryRestoring(false) } }, [isLive, historyServerId, apiFetch, loadLive, loadRevisions]) @@ -2492,8 +2495,8 @@ function FirewallPageInner() {