release: v3.26.76 版本号纠错(3.26.75→3.26.76)+ 升级箭头转圈动画

This commit is contained in:
qiqi committed 2026-11-25 20:57:49 +08:00
1 parent 10168cdd0b
commit 30214e04f9
7 files changed
+25 -8

No files matched your search

+7 -4
View File
@@ -22,9 +22,9 @@
// 升级图标(圆形内向上箭头):ICONS 在 app.js 里且行数已到棘轮上限,这里内联一份,不动宿主。
const UPGRADE_PATH = '<circle cx="12" cy="12" r="9"/><path d="M12 16V8"/><path d="m8.5 11.5 3.5-3.5 3.5 3.5"/>'
function UpgradeIcon () {
function UpgradeIcon (props) {
return el('svg', {
className: 'iwb-ic', viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor',
className: 'iwb-ic' + ((props && props.spinning) ? ' iwb-nav-up-spin' : ''), viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor',
strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true,
dangerouslySetInnerHTML: { __html: UPGRADE_PATH },
}, null)
@@ -67,6 +67,7 @@
const [morePos, setMorePos] = useState(null)
const [update, setUpdate] = useState(null) // null=无更新;{version,...}=有新版本
const [updateMsg, setUpdateMsg] = useState('')
const [upgrading, setUpgrading] = useState(false) // 升级中:箭头转圈(2026-11-26)
const checkUpdate = () => {
setUpdateMsg('正在检查…')
@@ -83,9 +84,11 @@
// 挂载后静默检查一次(仅桌面端;网页版 invoke 立即 reject,被 catch 吞掉,不留 UI 噪音)
useEffect(() => { checkUpdate() }, [])
const upgrade = () => {
if (upgrading) return
setUpgrading(true)
setUpdateMsg('正在下载并安装,完成后会自动重启…')
invoke('install_update').then(() => setUpdateMsg('安装完成,正在重启…'))
.catch((e) => setUpdateMsg('更新失败:' + String((e && e.message) || e)))
.catch((e) => { setUpgrading(false); setUpdateMsg('更新失败:' + String((e && e.message) || e)) })
}
useEffect(() => {
if (!moreOpen) return undefined
@@ -123,7 +126,7 @@
style: { left: morePos.left + 'px', bottom: morePos.bottom + 'px' },
onPointerDown: (e) => e.stopPropagation(),
},
update ? menuItem('up', el(UpgradeIcon, null), '升级到 v' + update.version + (update.notes ? ':' + update.notes : ''), act(upgrade), 'iwb-nav-more-up') : null,
update ? menuItem('up', el(UpgradeIcon, { spinning: upgrading }), (upgrading ? '正在升级… ' : '升级到 v') + update.version + (!upgrading && update.notes ? ':' + update.notes : ''), act(upgrade), 'iwb-nav-more-up' + (upgrading ? ' iwb-nav-more-up-busy' : '')) : null,
// 首页 / 插件 / 源码地址:全部打开**网站**(用户 2026-11-25 裁定),不再切软件内页面
menuItem('home', I('home'), '首页', act(() => openWeb(WEB_HOME)), null, '在浏览器打开官网首页 ' + WEB_HOME),
menuItem('plugins', I('box'), '插件', act(() => openWeb(WEB_PLUGINS)), null, '在浏览器打开插件市场 ' + WEB_PLUGINS),