mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
Merge pull request #584 from silentrald/bugfix/modal-options-undefined
[bugfix] handle undefined modal options properly
This commit is contained in:
@@ -17,7 +17,7 @@ export function Modal() {
|
||||
|
||||
useEffect(() => {
|
||||
const onEscape = (e: KeyboardEvent) => {
|
||||
if (currentModal.options.closable === false || e.key !== "Escape") {
|
||||
if (currentModal.options?.closable === false || e.key !== "Escape") {
|
||||
return;
|
||||
}
|
||||
currentModal.resolver({ exitCode: ModalExitCode.CLOSED });
|
||||
@@ -65,7 +65,7 @@ export function Modal() {
|
||||
}
|
||||
|
||||
const onOverlayClicked = () => {
|
||||
if (currentModal.options.closable === false) {
|
||||
if (currentModal.options?.closable === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user