Skip to content

Commit

Permalink
Tidy up onboarding in mobile controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
oskirby committed Dec 18, 2024
1 parent b30869f commit f8836b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
11 changes: 2 additions & 9 deletions src/platforms/android/androidcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,7 @@ AndroidController::AndroidController() {
Qt::QueuedConnection);
connect(
activity, &AndroidVPNActivity::eventOnboardingCompleted, this,
[this]() {
auto vpn = MozillaVPN::instance();
if (vpn->state() == App::StateOnboarding) {
vpn->onboardingCompleted();
emit disconnected();
}
},
[this]() { emit disconnected(); },
Qt::QueuedConnection);
connect(
activity, &AndroidVPNActivity::eventVpnConfigPermissionResponse, this,
Expand Down Expand Up @@ -251,8 +245,7 @@ void AndroidController::activate(const InterfaceConfig& config,
args["isUsingShortTimerSessionPing"] =
settingsHolder->shortTimerSessionPing();

args["isOnboarding"] =
MozillaVPN::instance()->state() == App::StateOnboarding;
args["isOnboarding"] = reason == Controller::ReasonOnboarding;

QJsonDocument doc(args);
AndroidVPNActivity::sendToService(ServiceAction::ACTION_ACTIVATE,
Expand Down
7 changes: 2 additions & 5 deletions src/platforms/ios/ioscontroller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,9 @@
}
}
onboardingCompletedCallback:^() {
BOOL isOnboarding = MozillaVPN::instance()->state() == App::StateOnboarding;
if (isOnboarding) {
if (reason == Controller::ReasonOnboarding) {
logger.debug() << "Onboarding completed";
MozillaVPN::instance()->onboardingCompleted();
} else {
logger.debug() << "Not onboarding";
emit disconnected();
}
}
vpnConfigPermissionResponseCallback:^(BOOL granted) {
Expand Down

0 comments on commit f8836b7

Please sign in to comment.