refactor(desktop): narrow home health board to expired/revoked accounts
Home 看板只保留已过期或已停用的账号,问题计数改用阻塞态 authState;新增 formatVerifiedAtLabel,统一校验通过时间的展示粒度。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,21 @@ export function formatDateTime(value: number | null): string {
|
||||
}).format(value);
|
||||
}
|
||||
|
||||
export function formatVerifiedAtLabel(value: number | null): string {
|
||||
if (!value) {
|
||||
return "尚未完成校验";
|
||||
}
|
||||
|
||||
const deltaMs = Math.abs(Date.now() - value);
|
||||
if (deltaMs < 60_000) {
|
||||
return "刚刚校验通过";
|
||||
}
|
||||
if (deltaMs < 60 * 60_000) {
|
||||
return `${Math.max(1, Math.round(deltaMs / 60_000))} 分钟前校验通过`;
|
||||
}
|
||||
return `${formatDateTime(value)} 校验通过`;
|
||||
}
|
||||
|
||||
export function titleCaseToken(value: string): string {
|
||||
return value
|
||||
.split(/[_-]/g)
|
||||
|
||||
Reference in New Issue
Block a user