Compare commits

...

6 Commits

Author SHA1 Message Date
Tom Wopat 69608ab853
Merge a741bbe7e3 into 28919bf37c 2025-11-05 15:25:03 -06:00
Aveline 28919bf37c
fix: await sleep needs to be called inside async function (#946) 2025-11-05 13:25:13 -06:00
Tom Wopat a741bbe7e3 pr feedback 2025-10-29 20:27:49 -04:00
Tom Wopat 1f7083a023 Revert "feat: add fullscreen button"
This reverts commit dc7791c245.
2025-09-25 09:09:17 -04:00
Tom Wopat dc7791c245 feat: add fullscreen button 2025-09-23 23:50:06 -04:00
Tom Wopat 9affd248f3 feat: allow pointer lock when no video 2025-09-23 23:50:05 -04:00
4 changed files with 6 additions and 4 deletions

View File

@ -417,7 +417,7 @@ export default function WebRTCVideo({ hasConnectionIssues }: { hasConnectionIssu
}); });
if (isRelativeMouseMode) { if (isRelativeMouseMode) {
videoElmRefValue.addEventListener("click", containerRef.current?.addEventListener("click",
() => { () => {
if (isPointerLockPossible && !isPointerLockActive && !document.pointerLockElement) { if (isPointerLockPossible && !isPointerLockActive && !document.pointerLockElement) {
requestPointerLock(); requestPointerLock();

View File

@ -12,6 +12,7 @@ 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();
@ -311,7 +312,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={() => { onClick={async () => {
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);

View File

@ -4,12 +4,13 @@ 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(() => { const onClose = useCallback(async () => {
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);

View File

@ -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(() => { const onClose = useCallback(async () => {
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);