fix: switch to no_network_screen if network manager is nil

This commit is contained in:
Siyuan 2025-10-10 15:22:09 +00:00
parent 403c1f8fa1
commit 110790a664
2 changed files with 6 additions and 1 deletions

View File

@ -184,7 +184,7 @@ func createErrorDump(logFile *os.File) {
fmt.Printf("error dump created: %s\n", filePath) fmt.Printf("error dump created: %s\n", filePath)
ensureSymlink(filePath, filepath.Join(errorDumpDir, "last-crash.log")) _ = ensureSymlink(filePath, filepath.Join(errorDumpDir, "last-crash.log"))
} }
func doSupervise() { func doSupervise() {

View File

@ -27,6 +27,11 @@ const (
) )
func switchToMainScreen() { func switchToMainScreen() {
if networkManager == nil {
nativeInstance.SwitchToScreenIfDifferent("no_network_screen")
return
}
if networkManager.IsUp() { if networkManager.IsUp() {
nativeInstance.SwitchToScreenIfDifferent("home_screen") nativeInstance.SwitchToScreenIfDifferent("home_screen")
} else { } else {