diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/MainActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/MainActivity.java index 9431092f..379dc7f3 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/MainActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/MainActivity.java @@ -54,6 +54,7 @@ import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.appbar.MaterialToolbar; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.navigation.NavigationView; +import com.google.android.material.snackbar.Snackbar; import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayoutMediator; import com.google.android.material.textfield.TextInputEditText; @@ -1113,6 +1114,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb .setCancelable(false) .show(); } + + @Override + public void onCheckFailed(String message) { + applySnackBarTheme(Snackbar.make(findViewById(android.R.id.content), getString(R.string.failed_to_check_token_validity,message), Snackbar.LENGTH_LONG)).show(); + } }); } } diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/user/FetchUserData.java b/app/src/main/java/eu/toldi/infinityforlemmy/user/FetchUserData.java index 0511e8e0..6288a701 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/user/FetchUserData.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/user/FetchUserData.java @@ -124,7 +124,7 @@ public class FetchUserData { @Override public void onFailure(@NonNull Call call, @NonNull Throwable t) { - validateAuthTokenListener.onValidateAuthTokenFailed(); + validateAuthTokenListener.onCheckFailed(t.getMessage()); } }); } @@ -133,6 +133,7 @@ public class FetchUserData { void onValidateAuthTokenSuccess(); void onValidateAuthTokenFailed(); + void onCheckFailed(String message); } public interface FetchUserUnreadCountListener { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f9904bed..16962ab8 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1334,4 +1334,5 @@ Don\'t hide your own read posts automatically deleted by creator removed by moderator + Failed to check token validity: %s \ No newline at end of file