From 50be2b342c292a42d2104aeabbf84a3fc1d7335a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Tainon?= Date: Mon, 29 Apr 2024 18:07:06 +0200 Subject: [PATCH] Do not import platform modules on the platform --- frontend/task/platform/platform.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/task/platform/platform.ts b/frontend/task/platform/platform.ts index 434d2f61..82b02aec 100644 --- a/frontend/task/platform/platform.ts +++ b/frontend/task/platform/platform.ts @@ -299,13 +299,16 @@ export function* canReloadAnswer(answer: TaskAnswer) { return false; } - const canChangePlatform = yield* appSelect(state => state.options.canChangePlatform); - const platform = yield* appSelect(state => state.options.platform); + const state = yield* appSelect(); + const canChangePlatform = state.options.canChangePlatform; + const platform = state.options.platform; if (!canChangePlatform && answer.platform !== platform) { return false; } - yield* call(importPlatformModules, answer.platform, window.modulesPath); + if (!state.options.preload) { + yield* call(importPlatformModules, answer.platform, window.modulesPath); + } return true; }