diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-08-04 15:48:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 15:48:29 +0200 |
commit | b59053ff8c5e15dcbc5b6a46463bc89495c0b0e1 (patch) | |
tree | 60cb7e886882667e1af436df798ac49b08900554 /app | |
parent | 93372fee1e9373833891a778b3f9cf321ca65723 (diff) |
Fix confirmation when closing media edition modal with unsaved changes (#26342)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/features/ui/components/focal_point_modal.jsx | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/features/ui/components/modal_root.jsx | 9 |
2 files changed, 2 insertions, 9 deletions
diff --git a/app/javascript/mastodon/features/ui/components/focal_point_modal.jsx b/app/javascript/mastodon/features/ui/components/focal_point_modal.jsx index 7169b8a279e..0c2e3901ea5 100644 --- a/app/javascript/mastodon/features/ui/components/focal_point_modal.jsx +++ b/app/javascript/mastodon/features/ui/components/focal_point_modal.jsx @@ -434,4 +434,4 @@ class FocalPointModal extends ImmutablePureComponent { export default connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true, -})(injectIntl(FocalPointModal, { withRef: true })); +})(injectIntl(FocalPointModal, { forwardRef: true })); diff --git a/app/javascript/mastodon/features/ui/components/modal_root.jsx b/app/javascript/mastodon/features/ui/components/modal_root.jsx index d5edb45b364..fb6acfaeaa9 100644 --- a/app/javascript/mastodon/features/ui/components/modal_root.jsx +++ b/app/javascript/mastodon/features/ui/components/modal_root.jsx @@ -97,14 +97,7 @@ export default class ModalRoot extends PureComponent { handleClose = (ignoreFocus = false) => { const { onClose } = this.props; - let message = null; - try { - message = this._modal?.getWrappedInstance?.().getCloseConfirmationMessage?.(); - } catch (_) { - // injectIntl defines `getWrappedInstance` but errors out if `withRef` - // isn't set. - // This would be much smoother with react-intl 3+ and `forwardRef`. - } + const message = this._modal?.getCloseConfirmationMessage?.(); onClose(message, ignoreFocus); }; |