Skip to content

Commit

Permalink
Fix code preservation of preferences change
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Aug 22, 2024
1 parent 51f6295 commit 5e480b1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@ function App() {

// Load content from source URL
useEffect(() => {
if (!(editor && url)) { return }
if (!editor || !url || code || codeFromUrl) {
// Do not execute if editor is not ready, if there is no URL to parse
// or if the editor already has some code loaded
// (last point is important for when settings change)
return
}
console.debug(`[Lean4web] Loading from ${url}`)
let txt = "Loading…"
setContent(txt)
Expand Down

0 comments on commit 5e480b1

Please sign in to comment.