mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 09:28:41 +00:00
use force connect
This commit is contained in:
parent
9a18062407
commit
ab125042e2
3 changed files with 4 additions and 3 deletions
|
|
@ -72,7 +72,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
|
||||
Future initAsync() async {
|
||||
setUserPlan();
|
||||
await apiService.connect();
|
||||
await apiService.connect(force: true);
|
||||
// call this function so invalid media files are get purged
|
||||
retryMediaUpload(true);
|
||||
}
|
||||
|
|
@ -84,7 +84,7 @@ class _AppState extends State<App> with WidgetsBindingObserver {
|
|||
if (wasPaused) {
|
||||
globalIsAppInBackground = false;
|
||||
twonlyDB.markUpdated();
|
||||
apiService.connect();
|
||||
apiService.connect(force: true);
|
||||
}
|
||||
} else if (state == AppLifecycleState.paused) {
|
||||
wasPaused = true;
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ class ApiService {
|
|||
String apiUrl = "ws$apiSecure://$apiHost/api/client";
|
||||
|
||||
Log.info("connecting to $apiUrl");
|
||||
|
||||
if (await _connectTo(apiUrl)) {
|
||||
await onConnected();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -561,7 +561,7 @@ Future redeemUserInviteCode(BuildContext context, String newPlan) async {
|
|||
);
|
||||
// reconnect to load new plan.
|
||||
await apiService.close(() {});
|
||||
await apiService.connect();
|
||||
await apiService.connect(force: true);
|
||||
} else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(errorCodeToText(context, res.error))),
|
||||
|
|
|
|||
Loading…
Reference in a new issue