Skip to content

Commit

Permalink
Do not import platform modules on the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienTainon committed Apr 29, 2024
1 parent 28271b5 commit 50be2b3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/task/platform/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 50be2b3

Please sign in to comment.