Skip to content

Commit 7380e94

Browse files
ci-bothsy822
authored andcommitted
fix: prevent race condition on initial tutorial load
1 parent 7b40a27 commit 7380e94

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

apps/learneth/src/App.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ function App(): JSX.Element {
5151
callback: () => {
5252
// @ts-ignore
5353
remixClient.call('locale', 'currentLocale').then((locale: any) => {
54-
loadRepo(locale)
54+
if (!(window as any).startTutorialCalled) {
55+
loadRepo(locale)
56+
}
5557
})
5658
// @ts-ignore
5759
remixClient.on('locale', 'localeChanged', (locale: any) => {

apps/learneth/src/remix-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class RemixClient extends PluginClient {
1010
}
1111

1212
startTutorial(name: any, branch: any, id: any): void {
13+
(window as any).startTutorialCalled = true
1314
void router.navigate('/home')
1415
store.dispatch({
1516
type: 'workshop/loadRepo',

0 commit comments

Comments
 (0)