@@ -113,7 +113,7 @@ const errors = {
113113 } ,
114114 [ ErrorCode . FLASH_SYSTEM_FAILED ] : {
115115 status : 'Flash failed' ,
116- description : 'AGNOS could not be flashed to your device. Try using a different cable, USB port, or computer. If ' +
116+ description : 'Try using a different cable, USB port, or computer. If ' +
117117 'the problem persists, join the #hw-three-3x channel on Discord for help.' ,
118118 icon : deviceExclamation ,
119119 } ,
@@ -659,8 +659,8 @@ export default function Flash() {
659659 title = status
660660 }
661661
662- // warn the user if they try to leave the page while flashing
663- if ( step >= StepCode . REPAIR_PARTITION_TABLES && step <= StepCode . FINALIZING ) {
662+ // warn the user if they try to leave the page while flashing (but not if there's an error)
663+ if ( step >= StepCode . REPAIR_PARTITION_TABLES && step <= StepCode . FINALIZING && error === ErrorCode . NONE ) {
664664 window . addEventListener ( "beforeunload" , beforeUnloadListener , { capture : true } )
665665 } else {
666666 window . removeEventListener ( "beforeunload" , beforeUnloadListener , { capture : true } )
@@ -692,7 +692,7 @@ export default function Flash() {
692692 </ div >
693693 < span className = "text-3xl dark:text-white font-mono font-light" > { title } </ span >
694694 < span className = "text-xl dark:text-white px-8 max-w-xl text-center" > { description } </ span >
695- { error && (
695+ { error !== ErrorCode . NONE && (
696696 < button
697697 className = "px-4 py-2 rounded-md bg-gray-200 hover:bg-gray-300 dark:bg-gray-700 dark:hover:bg-gray-600 text-gray-800 dark:text-gray-200 transition-colors"
698698 onClick = { handleRetry }
0 commit comments