create backup only when receiver found
This commit is contained in:
@@ -46,18 +46,12 @@ namespace ui {
|
||||
switch (opt) {
|
||||
case 0: {
|
||||
// Transfer selected
|
||||
auto backupResult = io::backup(index, g_currentUId);
|
||||
if (!std::get<0>(backupResult)) {
|
||||
mainApp->CreateShowDialog("Transfer", "Failed to create backup:\n" + std::get<2>(backupResult), {"OK"}, true);
|
||||
break;
|
||||
}
|
||||
auto directory = std::filesystem::path(std::get<2>(backupResult));
|
||||
{
|
||||
auto ovl = TransferOverlay::New("Transferring save data...");
|
||||
this->titlesMenu->SetVisible(false);
|
||||
mainApp->StartOverlay(ovl);
|
||||
this->LockInput();
|
||||
if (transfer_files(directory) != 0) {
|
||||
if (transfer_files(index, g_currentUId) != 0) {
|
||||
mainApp->EndOverlay();
|
||||
this->titlesMenu->SetVisible(true);
|
||||
this->UnlockInput();
|
||||
@@ -78,7 +72,7 @@ namespace ui {
|
||||
this->UnlockInput();
|
||||
}
|
||||
if (isClientConnectionFailed()) {
|
||||
mainApp->CreateShowDialog("Transfer", "No receiver found.\nMake sure the other Switch is in Receive mode.", {"OK"}, true);
|
||||
mainApp->CreateShowDialog("Transfer", getClientFailReason(), {"OK"}, true);
|
||||
} else if (isClientTransferCancelled()) {
|
||||
mainApp->CreateShowDialog("Transfer", "Transfer cancelled.", {"OK"}, true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user