From fa3ee31cd310eab763df686a510d7cc035994fb5 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 2 Feb 2023 10:30:16 +0800 Subject: [PATCH] Fix #55 --- src/components/account.jsx | 9 +++++++-- src/utils/states.js | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/account.jsx b/src/components/account.jsx index 87feb00..1c5e3ca 100644 --- a/src/components/account.jsx +++ b/src/components/account.jsx @@ -6,7 +6,7 @@ import emojifyText from '../utils/emojify-text'; import enhanceContent from '../utils/enhance-content'; import handleContentLinks from '../utils/handle-content-links'; import shortenNumber from '../utils/shorten-number'; -import states from '../utils/states'; +import states, { hideAllModals } from '../utils/states'; import store from '../utils/store'; import Avatar from './avatar'; @@ -218,7 +218,12 @@ function Account({ account, onClose }) { )}

- + { + hideAllModals(); + }} + > Posts
diff --git a/src/utils/states.js b/src/utils/states.js index 06daef9..3e1bc33 100644 --- a/src/utils/states.js +++ b/src/utils/states.js @@ -43,6 +43,14 @@ subscribe(states.settings, () => { ); }); +export function hideAllModals() { + states.showCompose = false; + states.showSettings = false; + states.showAccount = false; + states.showDrafts = false; + states.showMediaModal = false; +} + export function saveStatus(status, opts) { const { override, skipThreading } = Object.assign( { override: true, skipThreading: false },