create backup only when receiver found

This commit is contained in:
2026-04-25 10:46:20 +03:00
parent a2e874de85
commit 22b669fae0
6 changed files with 40 additions and 41 deletions
+2 -8
View File
@@ -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 {