Fix opening account page doesn't close the Accounts sheet

This commit is contained in:
Lim Chee Aun 2023-03-11 18:13:53 +08:00
parent adc4e8f53b
commit e6065403e5
2 changed files with 7 additions and 2 deletions

View file

@ -412,8 +412,11 @@ function App() {
<AccountSheet
account={snapStates.showAccount?.account || snapStates.showAccount}
instance={snapStates.showAccount?.instance}
onClose={() => {
onClose={({ destination }) => {
states.showAccount = false;
if (destination) {
states.showAccounts = false;
}
}}
/>
</Modal>

View file

@ -17,7 +17,9 @@ function AccountSheet({ account, instance: propInstance, onClose }) {
onClick={(e) => {
const accountBlock = e.target.closest('.account-block');
if (accountBlock) {
onClose();
onClose({
destination: 'account-statuses',
});
}
}}
>