Skip to content

Commit e8da88b

Browse files
committed
fix: incompatibility prompt did not pop up
1 parent c4dcf99 commit e8da88b

File tree

1 file changed

+14
-9
lines changed
  • packages/neuron-ui/src/containers/Navbar

1 file changed

+14
-9
lines changed

packages/neuron-ui/src/containers/Navbar/index.tsx

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,16 @@ const Navbar = () => {
116116
}, [i18n.language])
117117

118118
useEffect(() => {
119-
// isUpdated is true or version is not empty means check update has return
120-
if (!verifyCkbResult || (isUpdated !== true && !version)) {
121-
return
122-
}
123-
if (version && verifyCkbResult.shouldUpdate) {
119+
if (verifyCkbResult && !verifyCkbResult.withIndexer) {
124120
showGlobalAlertDialog({
125121
type: 'warning',
126-
message: t('navbar.update-neuron-with-ckb', { version: getVersion() }),
122+
message: t('navbar.ckb-without-indexer'),
127123
action: 'ok',
128124
})(dispatch)
129-
} else if (!verifyCkbResult.ckbIsCompatible) {
125+
return
126+
}
127+
128+
if (verifyCkbResult && !verifyCkbResult.ckbIsCompatible) {
130129
showGlobalAlertDialog({
131130
type: 'warning',
132131
message: (
@@ -142,10 +141,16 @@ const Navbar = () => {
142141
),
143142
action: 'ok',
144143
})(dispatch)
145-
} else if (!verifyCkbResult.withIndexer) {
144+
}
145+
146+
// isUpdated is true or version is not empty means check update has return
147+
if (!verifyCkbResult || (isUpdated !== true && !version)) {
148+
return
149+
}
150+
if (version && verifyCkbResult.shouldUpdate) {
146151
showGlobalAlertDialog({
147152
type: 'warning',
148-
message: t('navbar.ckb-without-indexer'),
153+
message: t('navbar.update-neuron-with-ckb', { version: getVersion() }),
149154
action: 'ok',
150155
})(dispatch)
151156
}

0 commit comments

Comments
 (0)