Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/src/ts/pages/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const page = new Page({
afterHide: async (): Promise<void> => {
TestLogic.restart({
noAnim: true,
skipInit: true,
});
void Funbox.clear();
void ModesNotice.update();
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/ts/test/test-logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ type RestartOptions = {
practiseMissed?: boolean;
noAnim?: boolean;
isQuickRestart?: boolean;
skipInit?: boolean;
};

export function restart(options = {} as RestartOptions): void {
Expand All @@ -184,6 +185,7 @@ export function restart(options = {} as RestartOptions): void {
noAnim: false,
nosave: false,
isQuickRestart: false,
skipInit: false,
};

options = { ...defaultOptions, ...options };
Expand Down Expand Up @@ -353,6 +355,12 @@ export function restart(options = {} as RestartOptions): void {
TestState.setPaceRepeat(repeatWithPace);
TestInitFailed.hide();
TestState.setTestInitSuccess(true);

if (options.skipInit) {
TestState.setTestRestarting(false);
return;
}
Comment thread
d1rshan marked this conversation as resolved.
Outdated

const initResult = await init();

if (!initResult) {
Expand Down
Loading