diff --git a/app/src/pages/Edit.tsx b/app/src/pages/Edit.tsx index e7f8d6737..5ec089405 100644 --- a/app/src/pages/Edit.tsx +++ b/app/src/pages/Edit.tsx @@ -105,10 +105,6 @@ export const loader: LoaderFunction = async ({ params }) => { /** check if edit already open for lesson/language */ setAtom(locked, await branchExists(`${lesson}-${language}`)); - if (getAtom(locked)) - window.setTimeout(() => { - window.alert(lockedMessage); - }, 1000); /** base raw folder containing json files */ const base = `${repoRaw}/main`; @@ -152,6 +148,12 @@ export const loader: LoaderFunction = async ({ params }) => { }); } + /** alert about locked status */ + if (getAtom(locked)) + window.setTimeout(() => { + window.alert(lockedMessage); + }, 1000); + return null; };