···55import SelectOptionJson from 'interfaces/select-option-json';
66import { route } from 'laroute';
77import * as React from 'react';
88+import { fail } from 'utils/fail';
89import { navigate } from 'utils/turbolinks';
9101011interface Props {
1112 currentItem: SelectOptionJson;
1213 items: SelectOptionJson[];
1313- type: 'judge_results' | 'multiplayer' | 'seasons';
1414+ type: 'daily_challenge' | 'judge_results' | 'multiplayer' | 'seasons';
1415}
15161617export default class BasicSelectOptions extends React.PureComponent<Props> {
···32333334 private href(id: number | null) {
3435 switch (this.props.type) {
3636+ case 'daily_challenge':
3737+ return route('daily-challenge.show', { daily_challenge: id ?? fail('missing id parameter') });
3538 case 'judge_results':
3639 return route('contest-entries.judge-results', { contest_entry: id ?? 0 });
3740 case 'multiplayer':
+1-4
resources/js/core/spoilerbox.ts
···11// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
22// See the LICENCE file in the repository root for full licence text.
3344+import { fail } from 'utils/fail';
45import { htmlElementOrNull } from 'utils/html';
55-66-function fail(message: string): never {
77- throw new Error(message);
88-}
96107function expand(e: JQuery.ClickEvent) {
118 e.stopPropagation();
+6
resources/js/utils/fail.ts
···11+// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
22+// See the LICENCE file in the repository root for full licence text.
33+44+export function fail(message: string): never {
55+ throw new Error(message);
66+}