Skip to content

Commit fc76dc5

Browse files
committed
Fix the latest version displayed incorrectly
1 parent cff6cf2 commit fc76dc5

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/pages/popup/components/Header/Extra.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ const HeartIcon = (
2020
</svg>
2121
)
2222

23+
const computeUpdateText = (version: string) => {
24+
return IS_FIREFOX
25+
? t(msg => msg.header.updateVersionInfo4Firefox, { version })
26+
: t(msg => msg.header.updateVersionInfo, { version })
27+
}
28+
2329
const Extra = defineComponent(() => {
2430
const { data: latestVersion } = useRequest(getLatestVersion)
25-
2631
const upgradeVisible = computed(() => latestVersion.value && packageInfo.version !== latestVersion.value && IS_FROM_STORE)
27-
2832
const { data: rateVisible } = useRequest(() => metaService.recommendRate())
2933

3034
const handleRateClick = async () => {
@@ -37,16 +41,11 @@ const Extra = defineComponent(() => {
3741
createTab(UPDATE_PAGE)
3842
}
3943

40-
const version = packageInfo.version
41-
const popInfo = IS_FIREFOX
42-
? t(msg => msg.header.updateVersionInfo4Firefox, { version })
43-
: t(msg => msg.header.updateVersionInfo, { version })
44-
4544
return () => {
4645
if (upgradeVisible.value) {
4746
return (
4847
<ElPopover
49-
content={popInfo}
48+
content={computeUpdateText(latestVersion.value)}
5049
effect="dark"
5150
width="auto"
5251
v-slots={{

0 commit comments

Comments
 (0)