mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-28 01:58:40 -05:00
Close modals on route change (#1613)
* Close modals on route change * Release notes * Fix import error
This commit is contained in:
committed by
GitHub
parent
fc62d85c23
commit
05e582793d
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { send } from 'loot-core/src/platform/client/fetch';
|
||||
|
||||
@@ -39,6 +40,13 @@ export default function Modals() {
|
||||
state => state.prefs.local && state.prefs.local.id,
|
||||
);
|
||||
const actions = useActions();
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (modalStack.length > 0) {
|
||||
actions.closeModal();
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
const syncServerStatus = useSyncServerStatus();
|
||||
|
||||
|
||||
6
upcoming-release-notes/1613.md
Normal file
6
upcoming-release-notes/1613.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [joel-jeremy]
|
||||
---
|
||||
|
||||
Close open modals when navigating to a different URL.
|
||||
Reference in New Issue
Block a user