Skip to content

Commit

Permalink
feat: only do login when there is a stored config (not on first run f…
Browse files Browse the repository at this point in the history
…or example)
  • Loading branch information
Oliver-Zimmerman committed Feb 7, 2025
1 parent a7f43df commit d00e484
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ Future<void> main() async {
// Check if we are from push, if we are do nothing, reconnection will happen there in handlePush. Otherwise connect
if (!txClientViewModel.callFromPush)
{
if (config is CredentialConfig)
if (config != null && config is CredentialConfig)
{
txClientViewModel.login(config),
}
else if (config is TokenConfig)
else if (config != null && config is TokenConfig)
{
txClientViewModel.loginWithToken(config),
},
Expand Down
15 changes: 2 additions & 13 deletions lib/view/telnyx_client_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,7 @@ class TelnyxClientViewModel with ChangeNotifier {
debug: true,
);
} else {
return CredentialConfig(
sipCallerIDName: 'Flutter Voice',
sipCallerIDNumber: '',
sipUser: MOCK_USER,
sipPassword: MOCK_PASSWORD,
debug: true,
);
return null;
}
}

Expand All @@ -407,12 +401,7 @@ class TelnyxClientViewModel with ChangeNotifier {
debug: true,
);
} else {
return TokenConfig(
sipCallerIDName: 'Flutter Voice',
sipCallerIDNumber: '',
sipToken: '',
debug: true,
);
return null;
}
}

Expand Down

0 comments on commit d00e484

Please sign in to comment.