mirror of
https://github.com/antebudimir/tempus.git
synced 2025-12-31 17:43:32 +00:00
On startup invoke goFromLogin() without waiting for checkPreviousSession() result
This commit is contained in:
parent
4ff870b05e
commit
eedae2e864
1 changed files with 3 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ import android.net.ConnectivityManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|
@ -78,6 +79,7 @@ public class MainActivity extends BaseActivity {
|
||||||
|
|
||||||
if (PreferenceUtil.getInstance(this).getToken() != null) {
|
if (PreferenceUtil.getInstance(this).getToken() != null) {
|
||||||
checkPreviousSession();
|
checkPreviousSession();
|
||||||
|
goFromLogin();
|
||||||
} else {
|
} else {
|
||||||
goToLogin();
|
goToLogin();
|
||||||
}
|
}
|
||||||
|
|
@ -95,13 +97,11 @@ public class MainActivity extends BaseActivity {
|
||||||
|
|
||||||
App.getApiClientInstance(getApplicationContext()).ensureWebSocket();
|
App.getApiClientInstance(getApplicationContext()).ensureWebSocket();
|
||||||
App.getApiClientInstance(getApplicationContext()).ReportCapabilities(clientCapabilities, new EmptyResponse());
|
App.getApiClientInstance(getApplicationContext()).ReportCapabilities(clientCapabilities, new EmptyResponse());
|
||||||
|
|
||||||
goFromLogin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception exception) {
|
public void onError(Exception exception) {
|
||||||
goFromLogin();
|
Toast.makeText(getApplicationContext(), exception.getMessage(), Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue