Skip to content

Commit e196bc5

Browse files
committed
Display config change text correctly
1 parent 9ea23f6 commit e196bc5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

frontend/src/helpers/ChangeDetails.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ export function changeDetails(change: Change): ChangeDetails {
154154
}
155155

156156
function configChangeTitle(config: Change_UpdateConfig): string {
157-
if (config.firstKickoffTeam) {
157+
if (config.firstKickoffTeam !== undefined && config.firstKickoffTeam !== 'UNKNOWN') {
158158
return `First kick-off team: ${config.firstKickoffTeam}`
159-
} else if (config.matchType) {
160-
return `Match type: ${config.matchType}`
161-
} else if (config.division) {
159+
} else if (config.division !== undefined && config.division !== 'DIV_UNKNOWN') {
162160
return `Division: ${config.division}`
161+
} else if (config.matchType !== undefined) {
162+
return `Match type: ${config.matchType}`
163163
}
164164
return "Unknown config change"
165165
}

internal/app/statemachine/change_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (s *StateMachine) processChangeUpdateConfig(newState *state.State, change *
1919
}
2020
}
2121
}
22-
if change.FirstKickoffTeam != nil {
22+
if change.FirstKickoffTeam != nil && *change.FirstKickoffTeam != state.Team_UNKNOWN {
2323
log.Printf("Change first kickoff team to %v", *change.FirstKickoffTeam)
2424
newState.FirstKickoffTeam = change.FirstKickoffTeam
2525
if *newState.Stage == state.Referee_NORMAL_FIRST_HALF_PRE {

0 commit comments

Comments
 (0)