feat:新增同步按钮

This commit is contained in:
hzm
2026-03-11 08:46:49 +08:00
parent 6a719fad1e
commit c28dd2d278
2 changed files with 23 additions and 1 deletions

View File

@@ -79,9 +79,11 @@ export default function Announcement() {
<p>1. 调整设置持仓相关弹框样式</p>
<p>2. 基金详情弹框支持设置持仓相关参数</p>
<p>3. 添加基金到分组弹框展示持仓金额数据</p>
<p>4. 已登录用户新增手动同步按钮</p>
<br/>
<p>答疑</p>
<p>因估值数据源问题大部分海外基金估值数据不准或没有暂时没有解决方案</p>
<p>1. 因估值数据源问题大部分海外基金估值数据不准或没有暂时没有解决方案</p>
<p>2. 因交易日用户人数过多为控制服务器免费额度上限暂时减少数据自动同步频率新增手动同步按钮</p>
<p>如有建议欢迎进用户支持群反馈</p>
</div>

View File

@@ -3716,6 +3716,26 @@ export default function HomePage() {
</div>
</div>
<div className="user-menu-divider" />
<button
className="user-menu-item"
disabled={isSyncing}
onClick={async () => {
setUserMenuOpen(false);
if (user?.id) await syncUserConfig(user.id);
}}
title="手动同步配置到云端"
>
{isSyncing ? (
<span className="loading-spinner" style={{ width: 16, height: 16, border: '2px solid var(--muted)', borderTopColor: 'var(--primary)', borderRadius: '50%', animation: 'spin 1s linear infinite', flexShrink: 0 }} />
) : (
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" style={{ flexShrink: 0 }}>
<path d="M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" stroke="var(--primary)" />
<path d="M12 12v9" stroke="var(--accent)" />
<path d="m16 16-4-4-4 4" stroke="var(--accent)" />
</svg>
)}
<span>{isSyncing ? '同步中...' : '同步'}</span>
</button>
<button
className="user-menu-item"
onClick={() => {