1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Fix for showing warning when no pending confirmations when network switching (#17179)

This commit is contained in:
aleksandar-mihajlovic 2023-01-17 22:37:35 +01:00 committed by GitHub
parent 082772fd08
commit 48dd819763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,7 @@ import {
getSnap,
///: END:ONLY_INCLUDE_IN
getUnapprovedTemplatedConfirmations,
getUnapprovedTxCount,
} from '../../selectors';
import NetworkDisplay from '../../components/app/network-display/network-display';
import Callout from '../../components/ui/callout';
@ -169,6 +170,7 @@ export default function ConfirmationPage({
const [alertState, dismissAlert] = useAlertState(pendingConfirmation);
const [templateState] = useTemplateState(pendingConfirmation);
const [showWarningModal, setShowWarningModal] = useState(false);
const unnaprovedTxsCount = useSelector(getUnapprovedTxCount);
const [inputStates, setInputStates] = useState({});
const setInputState = (key, value) => {
@ -339,6 +341,7 @@ export default function ConfirmationPage({
<ConfirmationFooter
alerts={
alertState[pendingConfirmation.id] &&
unnaprovedTxsCount > 0 &&
Object.values(alertState[pendingConfirmation.id])
.filter((alert) => alert.dismissed === false)
.map((alert, idx, filtered) => (