From 236e4db1a94607b804e1aae6d62355e2510d6289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 20 Aug 2024 10:23:30 +0200 Subject: [PATCH] Dropdown + modal fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/dropdown-menu/dropdown-menu.tsx | 2 +- src/components/modal-root.tsx | 4 +++- src/locales/pl.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/dropdown-menu/dropdown-menu.tsx b/src/components/dropdown-menu/dropdown-menu.tsx index cfc04bf86f..d6c4784e8d 100644 --- a/src/components/dropdown-menu/dropdown-menu.tsx +++ b/src/components/dropdown-menu/dropdown-menu.tsx @@ -108,7 +108,7 @@ const DropdownMenu = (props: IDropdownMenu) => { const { state } = history.location; if (goBack && state && (state as any).soapboxDropdownKey && (state as any).soapboxDropdownKey === dropdownHistoryKey.current) { history.goBack(); - (history.location.state as any).soapboxDropdownKey = true; + (history.location.state as any).soapboxDropdownKey = undefined; } closeDropdownMenu(); diff --git a/src/components/modal-root.tsx b/src/components/modal-root.tsx index 1a4ab25728..d51ca7b810 100644 --- a/src/components/modal-root.tsx +++ b/src/components/modal-root.tsx @@ -150,7 +150,9 @@ const ModalRoot: React.FC = ({ children, onCancel, onClose, type }) const handleModalOpen = () => { modalHistoryKey.current = Date.now(); unlistenHistory.current = history.listen(({ state }, action) => { - if (!(state as any)?.soapboxModalKey) { + if ((state as any)?.soapboxDropdownKey) { + return; + } else if (!(state as any)?.soapboxModalKey) { onClose(); } else if (action === 'POP') { handleOnClose(); diff --git a/src/locales/pl.json b/src/locales/pl.json index c9105a7b96..643dea0cdb 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -589,7 +589,7 @@ "crypto.lightning": "Lightning", "crypto_donate.explanation_box.message": "{siteTitle} przyjmuje darowizny w kryptowalutach. Możesz wysłać darowiznę na jeden z poniższych adresów. Dziękujemy za Wasze wsparcie!", "crypto_donate.explanation_box.title": "Przekaż darowiznę w kryptowalutach", - "crypto_donate_panel.actions.view": "Naciśnij, aby zobaczyć {count} więcej {count, plural, one {potrfel} few {portfele} many {portfeli}}", + "crypto_donate_panel.actions.view": "Naciśnij, aby zobaczyć {count} więcej {count, plural, one {potrfel} few {portfele} other {portfeli}}", "crypto_donate_panel.heading": "Przekaż kryptowalutę", "crypto_donate_panel.intro.message": "{siteTitle} przyjmuje darowizny w kryptowalutach, aby utrzymać naszą usługę. Dziękujemy za Wasze wsparcie!", "datepicker.day": "Dzień",