@@ -233,7 +233,7 @@ const MatchLiveStreams = lazyPanel(
233233 <SelectItem value="scoreboard">
234234 {{ $t("match.tabs.scoreboard") }}
235235 </SelectItem >
236- <SelectItem value="rounds">
236+ <SelectItem v-if = " showRoundsTab " value="rounds">
237237 {{ $t("match.tabs.rounds") }}
238238 </SelectItem >
239239 <template v-if =" ! disableStats " >
@@ -284,7 +284,7 @@ const MatchLiveStreams = lazyPanel(
284284 <TabsTrigger value="scoreboard">
285285 {{ $t("match.tabs.scoreboard") }}
286286 </TabsTrigger >
287- <TabsTrigger value="rounds">
287+ <TabsTrigger v-if = " showRoundsTab " value="rounds">
288288 {{ $t("match.tabs.rounds") }}
289289 </TabsTrigger >
290290 <template v-if =" ! disableStats " >
@@ -543,8 +543,12 @@ const MatchLiveStreams = lazyPanel(
543543 </div >
544544 </Transition >
545545 </TabsContent >
546- <TabsContent value="rounds" class="tab-panel-in mt-0">
547- <MatchRoundsPanel :match =" match " :match-map =" roundsMap " />
546+ <TabsContent
547+ v-if =" showRoundsTab "
548+ value="rounds"
549+ class="tab-panel-in mt-0"
550+ >
551+ <MatchRoundsPanel :match =" match " :match-map =" currentMap " />
548552 </TabsContent >
549553 <TabsContent value="economy" class="tab-panel-in mt-0">
550554 <div class =" grid gap-4 max-w-[1500px]" >
@@ -1178,17 +1182,13 @@ export default {
11781182 effectiveScoreboardLens() {
11791183 return this .disableStats ? " general" : this .scoreboardLens ;
11801184 },
1181- // The map the Rounds tab shows: the one picked above the tabs, else the
1182- // map being played, else the last one with rounds.
1183- roundsMap() {
1184- const maps = this .match .match_maps ?? [];
1185- if (this .activeMap ) {
1186- return maps .find ((map : any ) => map .id === this .activeMap ! .id ) ?? null ;
1187- }
1185+ // Rounds is for resets, so it only shows for the map being played; a
1186+ // finished map's rounds are on its own card.
1187+ showRoundsTab() {
11881188 return (
1189- maps . find (( map : any ) => map . is_current_map ) ??
1190- [ ... maps ]. reverse (). find (( map : any ) => map . rounds ?. length ) ??
1191- null
1189+ this . match . status === e_match_status_enum . Live &&
1190+ !! this . currentMap &&
1191+ ( ! this . activeMap || this . activeMap . id === this . currentMap . id )
11921192 );
11931193 },
11941194 isOpsTabActive() {
@@ -1395,7 +1395,11 @@ export default {
13951395 return true ;
13961396 },
13971397 availableMatchTabs() {
1398- const tabs = [" scoreboard" , " rounds" ];
1398+ const tabs = [" scoreboard" ];
1399+
1400+ if (this .showRoundsTab ) {
1401+ tabs .push (" rounds" );
1402+ }
13991403
14001404 if (! this .disableStats ) {
14011405 tabs .push (" economy" );
@@ -1438,14 +1442,17 @@ export default {
14381442 if (this .activeMap && this .activeMap .id !== current ?.id ) {
14391443 this .$emit (" clear-active-map" );
14401444 }
1441- this . activeTab = " rounds " ;
1445+ // Rounds only exists once a finished map's pick has cleared.
14421446 void this .$nextTick (() => {
1443- const reduce = window .matchMedia ?.(
1444- " (prefers-reduced-motion: reduce)" ,
1445- ).matches ;
1446- (this .$el as HTMLElement | undefined )?.scrollIntoView ?.({
1447- behavior: reduce ? " auto" : " smooth" ,
1448- block: " start" ,
1447+ this .activeTab = " rounds" ;
1448+ void this .$nextTick (() => {
1449+ const reduce = window .matchMedia ?.(
1450+ " (prefers-reduced-motion: reduce)" ,
1451+ ).matches ;
1452+ (this .$el as HTMLElement | undefined )?.scrollIntoView ?.({
1453+ behavior: reduce ? " auto" : " smooth" ,
1454+ block: " start" ,
1455+ });
14491456 });
14501457 });
14511458 },
0 commit comments