Skip to content

Commit

Permalink
Bug: ASM/CPU titles whould disappear after re-clicking header button (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
netalondon authored May 8, 2024
1 parent 98fb9f9 commit 04baa49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web/src/pages/asm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ export const Asm = () => {

const [showSymbolTable, setShowSymbolTable] = useState(true);

useEffect(() => {
if (state?.path) {
setTitle(state.path.split("/").pop() ?? "");
}
});

useEffect(() => {
if (toolStates.asmState) {
actions.overrideState(toolStates.asmState);
if (toolStates.asmState.path) {
setTitle(toolStates.asmState.path.split("/").pop() ?? "");
}
}
}, []);

Expand Down
4 changes: 4 additions & 0 deletions web/src/pages/cpu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const CPU = () => {

useEffect(() => {
toolStates.setCpuState(fileName, state.sim.ROM, romFormat);
if (fileName) {
const name = fileName.split("/").pop() ?? "";
setTitle(name);
}
});

useEffect(() => {
Expand Down

0 comments on commit 04baa49

Please sign in to comment.