From 2659d87bbeff4b311701aaddfcef6eb6c982d8b0 Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Thu, 2 Sep 2021 08:07:11 +0200 Subject: [PATCH] Re-enable single release handler (#974) Was disabled in #958 due to crashes related to this. This re-enables it but fixes the crashes. Also adresses #955 - [X] I carefully read the [contribution guidelines](https://codeberg.org/GitNex/GitNex/src/branch/main/CONTRIBUTING.md). - [X] I'm following the code standards as defined [here](https://codeberg.org/gitnex/GitNex/wiki/Code-Standards). - [X] By submitting this pull request, I permit GitNex to license my work under the [GNU General Public License v3](https://codeberg.org/GitNex/GitNex/src/branch/main/LICENSE). Co-authored-by: qwerty287 Reviewed-on: https://codeberg.org/gitnex/GitNex/pulls/974 Reviewed-by: M M Arif Co-authored-by: qwerty287 Co-committed-by: qwerty287 --- .../mian/gitnex/activities/DeepLinksActivity.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java b/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java index 120d960a..bbf5cad2 100644 --- a/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java +++ b/app/src/main/java/org/mian/gitnex/activities/DeepLinksActivity.java @@ -274,13 +274,14 @@ public class DeepLinksActivity extends BaseActivity { goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1), "newRelease"), 500); } else if(data.getPathSegments().get(2).equals("releases")) { // releases - new Handler(Looper.getMainLooper()).postDelayed(() -> - goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1), "releases"), 500); - } - else if(data.getPathSegments().get(2).equals("releases") && data.getPathSegments().get(3).equals("tag") && data.getPathSegments().size() == 5) { // release - repoIntent.putExtra("releaseTagName", data.getLastPathSegment()); - new Handler(Looper.getMainLooper()).postDelayed(() -> - goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1), "releases"), 500); + if(data.getPathSegments().size() == 5) { + if(data.getPathSegments().get(2).equals("releases") && data.getPathSegments().get(3).equals("tag")) { + repoIntent.putExtra("releaseTagName", data.getLastPathSegment()); + } + } + new Handler(Looper.getMainLooper()).postDelayed( + () -> goToRepoSection(currentInstance, instanceToken, data.getPathSegments().get(0), data.getPathSegments().get(1), + "releases"), 500); } else if(data.getPathSegments().get(2).equals("labels")) { // labels new Handler(Looper.getMainLooper()).postDelayed(() ->