diff --git a/bun.lockb b/bun.lockb
deleted file mode 100755
index c6d81df..0000000
Binary files a/bun.lockb and /dev/null differ
diff --git a/src/app/App.jsx b/src/app/App.jsx
index 8aceb77..f62c5e9 100644
--- a/src/app/App.jsx
+++ b/src/app/App.jsx
@@ -5,7 +5,7 @@ import fastbootPorts from '../assets/fastboot-ports.svg'
import zadigCreateNewDevice from '../assets/zadig_create_new_device.png'
import zadigForm from '../assets/zadig_form.png'
-const Flash = lazy(() => import('./Flash'));
+const Flash = lazy(() => import('./Flash.client'));
export default function App() {
const version = import.meta.env.VITE_PUBLIC_GIT_SHA || 'dev'
diff --git a/src/app/Flash.jsx b/src/app/Flash.client.jsx
similarity index 92%
rename from src/app/Flash.jsx
rename to src/app/Flash.client.jsx
index d7c544d..614fa09 100644
--- a/src/app/Flash.jsx
+++ b/src/app/Flash.client.jsx
@@ -1,4 +1,6 @@
-import { useCallback } from 'react'
+'use client';
+
+import { useCallback, useEffect } from 'react'
import { Step, Error, useFastboot } from '@/utils/fastboot'
@@ -16,11 +18,6 @@ import systemUpdate from '@/assets/system_update_c3.svg'
const steps = {
- [Step.INITIALIZING]: {
- status: 'Initializing...',
- bgColor: 'bg-gray-400 dark:bg-gray-700',
- icon: cloud,
- },
[Step.READY]: {
status: 'Ready',
description: 'Tap the button above to begin',
@@ -189,10 +186,6 @@ export default function Flash() {
serial,
} = useFastboot()
- const handleContinue = useCallback(() => {
- onContinue?.()
- }, [onContinue])
-
const handleRetry = useCallback(() => {
onRetry?.()
}, [onRetry])
@@ -214,18 +207,24 @@ export default function Flash() {
}
// warn the user if they try to leave the page while flashing
- if (Step.DOWNLOADING <= step && step <= Step.ERASING) {
- window.addEventListener("beforeunload", beforeUnloadListener, { capture: true })
- } else {
- window.removeEventListener("beforeunload", beforeUnloadListener, { capture: true })
- }
+ useEffect(() => {
+ if (Step.DOWNLOADING <= step && step <= Step.ERASING) {
+ window.addEventListener("beforeunload", beforeUnloadListener, { capture: true })
+ } else {
+ window.removeEventListener("beforeunload", beforeUnloadListener, { capture: true })
+ }
+
+ return () => {
+ window.removeEventListener("beforeunload", beforeUnloadListener, { capture: true })
+ }
+ }, [step])
return (
-
{title}
-
{description}
+
+ {title}
+
+
+ {description}
+
{error && (