|
@@ -55,7 +55,12 @@ export const compareVersions = (v1: string, v2: string): number => {
|
|
|
*/
|
|
*/
|
|
|
export const shouldShowUpdate = (lastViewedVersion: string | null): boolean => {
|
|
export const shouldShowUpdate = (lastViewedVersion: string | null): boolean => {
|
|
|
if (!lastViewedVersion) return true;
|
|
if (!lastViewedVersion) return true;
|
|
|
- return compareVersions(CURRENT_VERSION, lastViewedVersion) > 0;
|
|
|
|
|
|
|
+ // 三重保险:严格相等 + 字符串比较 + 版本号比较
|
|
|
|
|
+ const isStrictEqual = CURRENT_VERSION === lastViewedVersion;
|
|
|
|
|
+ const isStringEqual = String(CURRENT_VERSION) === String(lastViewedVersion);
|
|
|
|
|
+ const isVersionEqual = compareVersions(CURRENT_VERSION, lastViewedVersion) === 0;
|
|
|
|
|
+ // 只有三个条件都满足时才不显示,否则都要弹
|
|
|
|
|
+ return !(isStrictEqual && isStringEqual && isVersionEqual);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
/**
|