mirror of https://github.com/jetkvm/kvm.git
Compare commits
1 Commits
ed98e3974f
...
2097de9b6e
| Author | SHA1 | Date |
|---|---|---|
|
|
2097de9b6e |
|
|
@ -12,7 +12,6 @@ import { TextAreaWithLabel } from "@components/TextArea";
|
||||||
import { isOnDevice } from "@/main";
|
import { isOnDevice } from "@/main";
|
||||||
import notifications from "@/notifications";
|
import notifications from "@/notifications";
|
||||||
import { m } from "@localizations/messages.js";
|
import { m } from "@localizations/messages.js";
|
||||||
import { sleep } from "@/utils";
|
|
||||||
|
|
||||||
export default function SettingsAdvancedRoute() {
|
export default function SettingsAdvancedRoute() {
|
||||||
const { send } = useJsonRpc();
|
const { send } = useJsonRpc();
|
||||||
|
|
@ -312,7 +311,7 @@ export default function SettingsAdvancedRoute() {
|
||||||
size="SM"
|
size="SM"
|
||||||
theme="light"
|
theme="light"
|
||||||
text={m.advanced_reset_config_button()}
|
text={m.advanced_reset_config_button()}
|
||||||
onClick={async () => {
|
onClick={() => {
|
||||||
handleResetConfig();
|
handleResetConfig();
|
||||||
// Add 2s delay between resetting the configuration and calling reload() to prevent reload from interrupting the RPC call to reset things.
|
// Add 2s delay between resetting the configuration and calling reload() to prevent reload from interrupting the RPC call to reset things.
|
||||||
await sleep(2000);
|
await sleep(2000);
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,12 @@ import { useNavigate } from "react-router";
|
||||||
import { useJsonRpc } from "@hooks/useJsonRpc";
|
import { useJsonRpc } from "@hooks/useJsonRpc";
|
||||||
import { Button } from "@components/Button";
|
import { Button } from "@components/Button";
|
||||||
import { m } from "@localizations/messages.js";
|
import { m } from "@localizations/messages.js";
|
||||||
import { sleep } from "@/utils";
|
|
||||||
|
|
||||||
export default function SettingsGeneralRebootRoute() {
|
export default function SettingsGeneralRebootRoute() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { send } = useJsonRpc();
|
const { send } = useJsonRpc();
|
||||||
|
|
||||||
const onClose = useCallback(async () => {
|
const onClose = useCallback(() => {
|
||||||
navigate(".."); // back to the devices.$id.settings page
|
navigate(".."); // back to the devices.$id.settings page
|
||||||
// Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
|
// Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
|
||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export default function SettingsGeneralUpdateRoute() {
|
||||||
const { setModalView, otaState } = useUpdateStore();
|
const { setModalView, otaState } = useUpdateStore();
|
||||||
const { send } = useJsonRpc();
|
const { send } = useJsonRpc();
|
||||||
|
|
||||||
const onClose = useCallback(async () => {
|
const onClose = useCallback(() => {
|
||||||
navigate(".."); // back to the devices.$id.settings page
|
navigate(".."); // back to the devices.$id.settings page
|
||||||
// Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
|
// Add 1s delay between navigation and calling reload() to prevent reload from interrupting the navigation.
|
||||||
await sleep(1000);
|
await sleep(1000);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue