Skip to content

Commit 432c39e

Browse files
committed
Block ftp menu when there is no internet connection.
1 parent c93ee81 commit 432c39e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

source/main.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ void mainMenuLoop(int kDown) {
3030
}
3131

3232
else if (kDown & KEY_Y) {
33-
menu = FTP_MENU;
33+
nifmInitialize();
34+
NifmInternetConnectionStatus connectionStatus;
35+
if(R_SUCCEEDED(nifmGetInternetConnectionStatus(nullptr, nullptr, &connectionStatus))) {
36+
if(connectionStatus == NifmInternetConnectionStatus_Connected)
37+
menu = FTP_MENU;
38+
}
39+
nifmExit();
3440
}
3541
}
3642

0 commit comments

Comments
 (0)