Fix unbound callback in App (#1266)

## Summary
- ensure `onSetFileHandle` keeps the right `this`
- cover export dialog save with regression test

## Testing
- `npm run lint`
- `npm run build`
- `xvfb-run -a npx cypress run --spec cypress/e2e/modals.cy.ts` *(fails:
Failed to execute 'showSaveFilePicker' due to environment issues)*

------
https://chatgpt.com/codex/tasks/task_e_68690228e2cc8331a76abc157e8aadf3
This commit is contained in:
Bart Louwers
2025-07-05 13:55:05 +02:00
committed by GitHub
parent 244dbfb194
commit c486aa2139

View File

@@ -877,8 +877,8 @@ export default class App extends React.Component<any, AppState> {
this.setModal(modalName, !this.state.isOpen[modalName]);
}
onSetFileHandle(fileHandle: FileSystemFileHandle | null) {
this.setState({fileHandle: fileHandle});
onSetFileHandle = (fileHandle: FileSystemFileHandle | null) => {
this.setState({ fileHandle });
}
onChangeOpenlayersDebug = (key: keyof AppState["openlayersDebugOptions"], value: boolean) => {