Move `initActiveTab()` from change view into model
The change view just reflects the `tab` property of the view state.
Release-Notes: skip
Change-Id: I0a5c139878caa0b9432401520b6296cb0d9fdfed
diff --git a/polygerrit-ui/app/models/views/change.ts b/polygerrit-ui/app/models/views/change.ts
index 4a14a80..3ac79d0 100644
--- a/polygerrit-ui/app/models/views/change.ts
+++ b/polygerrit-ui/app/models/views/change.ts
@@ -290,7 +290,11 @@
public readonly childView$ = select(this.state$, state => state?.childView);
- public readonly tab$ = select(this.state$, state => state?.tab);
+ public readonly tab$ = select(this.state$, state => {
+ if (state?.commentId) return Tab.COMMENT_THREADS;
+ if (state?.tab) return state.tab;
+ return Tab.FILES;
+ });
public readonly checksPatchset$ = select(
this.state$,