Skip to content

Commit

Permalink
move lock alert to end of data loader
Browse files Browse the repository at this point in the history
  • Loading branch information
vincerubinetti committed Feb 27, 2024
1 parent 9ae53aa commit 59ddc7d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/src/pages/Edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit 59ddc7d

Please sign in to comment.