From 8de22bfb0376a8ca56cb5a4894a37469ac750219 Mon Sep 17 00:00:00 2001 From: chenyan Date: Tue, 13 May 2025 11:49:33 +0800 Subject: [PATCH] fix: incompatibility prompt did not pop up --- .../neuron-ui/src/containers/Navbar/index.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/neuron-ui/src/containers/Navbar/index.tsx b/packages/neuron-ui/src/containers/Navbar/index.tsx index 3713409c20..d034cdf04b 100644 --- a/packages/neuron-ui/src/containers/Navbar/index.tsx +++ b/packages/neuron-ui/src/containers/Navbar/index.tsx @@ -125,17 +125,7 @@ const Navbar = () => { return } - // isUpdated is true or version is not empty means check update has return - if (!verifyCkbResult || (isUpdated !== true && !version)) { - return - } - if (version && verifyCkbResult.shouldUpdate) { - showGlobalAlertDialog({ - type: 'warning', - message: t('navbar.update-neuron-with-ckb', { version: getVersion() }), - action: 'ok', - })(dispatch) - } else if (!verifyCkbResult.ckbIsCompatible) { + if (verifyCkbResult && !verifyCkbResult.ckbIsCompatible) { showGlobalAlertDialog({ type: 'warning', message: ( @@ -152,6 +142,18 @@ const Navbar = () => { action: 'ok', })(dispatch) } + + // isUpdated is true or version is not empty means check update has return + if (!verifyCkbResult || (isUpdated !== true && !version)) { + return + } + if (version && verifyCkbResult.shouldUpdate) { + showGlobalAlertDialog({ + type: 'warning', + message: t('navbar.update-neuron-with-ckb', { version: getVersion() }), + action: 'ok', + })(dispatch) + } }, [verifyCkbResult, version, isUpdated]) useEffect(() => {