Compare commits

..

No commits in common. "c462e1c2b5354a0415f4ad68d9841647e7233de4" and "f3138e9681ab6ac0363e7ee07b314dc91caa38fd" have entirely different histories.

2 changed files with 9 additions and 23 deletions

View File

@ -88,17 +88,9 @@ export const VersionPanel: React.FC<VersionPanelProps> = ({
const parsed = parseChangelog(content); const parsed = parseChangelog(content);
setRemoteChangelog(parsed); setRemoteChangelog(parsed);
// 检查是否有更新 - 基于日期而非版本号数字大小来确定最新版本 // 检查是否有更新
if (parsed.length > 0) { if (parsed.length > 0) {
// 按日期排序,找到真正的最新版本 const latest = parsed[0];
const sortedByDate = [...parsed].sort((a, b) => {
// 解析日期进行比较
const dateA = new Date(a.date);
const dateB = new Date(b.date);
return dateB.getTime() - dateA.getTime(); // 降序排列,最新的在前
});
const latest = sortedByDate[0];
setLatestVersion(latest.version); setLatestVersion(latest.version);
setIsHasUpdate( setIsHasUpdate(
compareVersions(latest.version) === UpdateStatus.HAS_UPDATE compareVersions(latest.version) === UpdateStatus.HAS_UPDATE
@ -196,10 +188,10 @@ export const VersionPanel: React.FC<VersionPanelProps> = ({
<div <div
key={entry.version} key={entry.version}
className={`p-4 rounded-lg border ${isCurrentVersion className={`p-4 rounded-lg border ${isCurrentVersion
? 'bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800' ? 'bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800'
: isUpdate : isUpdate
? 'bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800' ? 'bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800'
: 'bg-gray-50 dark:bg-gray-800/60 border-gray-200 dark:border-gray-700' : 'bg-gray-50 dark:bg-gray-800/60 border-gray-200 dark:border-gray-700'
}`} }`}
> >
{/* 版本标题 */} {/* 版本标题 */}
@ -449,18 +441,12 @@ export const VersionPanel: React.FC<VersionPanelProps> = ({
); );
return !localVersions.includes(entry.version); return !localVersions.includes(entry.version);
}) })
.sort((a, b) => {
// 按日期排序,确保最新的版本在前面显示
const dateA = new Date(a.date);
const dateB = new Date(b.date);
return dateB.getTime() - dateA.getTime(); // 降序排列,最新的在前
})
.map((entry, index) => ( .map((entry, index) => (
<div <div
key={index} key={index}
className={`p-4 rounded-lg border ${entry.version === latestVersion className={`p-4 rounded-lg border ${entry.version === latestVersion
? 'bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800' ? 'bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800'
: 'bg-gray-50 dark:bg-gray-800/60 border-gray-200 dark:border-gray-700' : 'bg-gray-50 dark:bg-gray-800/60 border-gray-200 dark:border-gray-700'
}`} }`}
> >
<div className='flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-3'> <div className='flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-3'>

View File

@ -1,6 +1,6 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
const CURRENT_VERSION = '8.9.5'; const CURRENT_VERSION = '8.9.0';
// 导出当前版本号供其他地方使用 // 导出当前版本号供其他地方使用
export { CURRENT_VERSION }; export { CURRENT_VERSION };