Check state tab before url tab

When deciding which tab to open, give first preference to the
state(which may change as user clicks around) vs the one in the
url which will not be cleared as long as the param is in the url.

Release-Notes: skip
Google-bug-id: b/282849399
Change-Id: Ifb5da5b5a8be132ff63308f97e0d6bab338c707d
diff --git a/polygerrit-ui/app/models/views/change.ts b/polygerrit-ui/app/models/views/change.ts
index 127f77b..6cd7a0b 100644
--- a/polygerrit-ui/app/models/views/change.ts
+++ b/polygerrit-ui/app/models/views/change.ts
@@ -308,8 +308,8 @@
   public readonly childView$ = select(this.state$, state => state?.childView);
 
   public readonly tab$ = select(this.state$, state => {
-    if (state?.commentId) return Tab.COMMENT_THREADS;
     if (state?.tab) return state.tab;
+    if (state?.commentId) return Tab.COMMENT_THREADS;
     return Tab.FILES;
   });