Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
e108984a13 chore(deps): bump koffi from 2.15.2 to 2.15.4
Bumps [koffi](https://github.com/Koromix/koffi) from 2.15.2 to 2.15.4.
- [Commits](https://github.com/Koromix/koffi/commits)

---
updated-dependencies:
- dependency-name: koffi
  dependency-version: 2.15.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-03 23:16:21 +00:00
6 changed files with 32 additions and 58 deletions

1
.gitignore vendored
View File

@@ -72,4 +72,3 @@ pnpm-lock.yaml
/pnpm-workspace.yaml
wechat-research-site
.codex
weflow-web-offical

View File

@@ -136,7 +136,6 @@ const shouldOfferUpdateForTrack = (latestVersion: string, currentVersion: string
}
let lastAppliedUpdaterChannel: string | null = null
let lastAppliedUpdaterFeedUrl: string | null = null
const resetUpdaterProviderCache = () => {
const updater = autoUpdater as any
// electron-updater 会缓存 provider切换 channel 后需清理缓存,避免仍请求旧通道
@@ -147,41 +146,23 @@ const resetUpdaterProviderCache = () => {
}
}
const getUpdaterFeedUrlByTrack = (track: 'stable' | 'preview' | 'dev'): string => {
const repoBase = 'https://github.com/hicccc77/WeFlow/releases'
if (track === 'stable') return `${repoBase}/latest/download`
if (track === 'preview') return `${repoBase}/download/nightly-preview`
return `${repoBase}/download/nightly-dev`
}
const applyAutoUpdateChannel = (reason: 'startup' | 'settings' = 'startup') => {
const track = getEffectiveUpdateTrack()
const currentTrack = inferUpdateTrackFromVersion(appVersion)
const baseUpdateChannel = track === 'stable' ? 'latest' : track
const nextFeedUrl = getUpdaterFeedUrlByTrack(track)
const nextUpdaterChannel =
process.platform === 'win32' && process.arch === 'arm64'
? `${baseUpdateChannel}-arm64`
: baseUpdateChannel
if (
(lastAppliedUpdaterChannel && lastAppliedUpdaterChannel !== nextUpdaterChannel) ||
(lastAppliedUpdaterFeedUrl && lastAppliedUpdaterFeedUrl !== nextFeedUrl)
) {
if (lastAppliedUpdaterChannel && lastAppliedUpdaterChannel !== nextUpdaterChannel) {
resetUpdaterProviderCache()
}
autoUpdater.allowPrerelease = track !== 'stable'
// 只要用户当前选择的目标通道与当前安装版本所属通道不同,就允许跨通道更新(含降级)
autoUpdater.allowDowngrade = track !== currentTrack
// 统一走 generic feed确保 preview/dev 命中各自固定发布页,不受 GitHub provider 的 prerelease 选择影响。
autoUpdater.setFeedURL({
provider: 'generic',
url: nextFeedUrl,
channel: nextUpdaterChannel
})
autoUpdater.channel = nextUpdaterChannel
lastAppliedUpdaterChannel = nextUpdaterChannel
lastAppliedUpdaterFeedUrl = nextFeedUrl
console.log(`[Update](${reason}) 当前版本 ${appVersion},当前轨道: ${currentTrack},渠道偏好: ${track},更新通道: ${autoUpdater.channel}feed=${nextFeedUrl}allowDowngrade=${autoUpdater.allowDowngrade}`)
console.log(`[Update](${reason}) 当前版本 ${appVersion},当前轨道: ${currentTrack},渠道偏好: ${track},更新通道: ${autoUpdater.channel}allowDowngrade=${autoUpdater.allowDowngrade}`)
}
applyAutoUpdateChannel('startup')

8
package-lock.json generated
View File

@@ -19,7 +19,7 @@
"html2canvas": "^1.4.1",
"jieba-wasm": "^2.2.0",
"jszip": "^3.10.1",
"koffi": "^2.9.0",
"koffi": "^2.15.4",
"lucide-react": "^1.7.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",
@@ -6531,9 +6531,9 @@
}
},
"node_modules/koffi": {
"version": "2.15.2",
"resolved": "https://registry.npmjs.org/koffi/-/koffi-2.15.2.tgz",
"integrity": "sha512-r9tjJLVRSOhCRWdVyQlF3/Ugzeg13jlzS4czS82MAgLff4W+BcYOW7g8Y62t9O5JYjYOLAjAovAZDNlDfZNu+g==",
"version": "2.15.4",
"resolved": "https://registry.npmjs.org/koffi/-/koffi-2.15.4.tgz",
"integrity": "sha512-6l7xxt8heHWQ63WyGd8ofne4TrzhqeKHhvSlI3GnxMIHp3PlDrOPyZbW5YNINXNma1qrKkpM/PGLY8U0V8Hxbw==",
"hasInstallScript": true,
"license": "MIT",
"funding": {

View File

@@ -33,7 +33,7 @@
"html2canvas": "^1.4.1",
"jieba-wasm": "^2.2.0",
"jszip": "^3.10.1",
"koffi": "^2.9.0",
"koffi": "^2.15.4",
"lucide-react": "^1.7.0",
"react": "^19.2.3",
"react-dom": "^19.2.3",

View File

@@ -591,13 +591,9 @@ function App() {
<div className="agreement-notice">
<strong></strong>
<span className="agreement-notice-link">
<a href="https://weflow.top" target="_blank" rel="noreferrer">
https://weflow.top
</a>
&nbsp;·&nbsp;
<a href="https://github.com/hicccc77/WeFlow" target="_blank" rel="noreferrer">
GitHub
https://github.com/hicccc77/WeFlow
</a>
</span>
</div>
@@ -612,7 +608,7 @@ function App() {
<p>使使</p>
<h4>4. </h4>
<p></p>
<p></p>
</div>
</div>
<div className="agreement-footer">
@@ -670,30 +666,30 @@ function App() {
)}
{showWaylandWarning && (
<div className="agreement-overlay">
<div className="agreement-modal">
<div className="agreement-header">
<Shield size={32} />
<h2> (Wayland)</h2>
</div>
<div className="agreement-content">
<div className="agreement-text">
<p>使 <strong>Wayland</strong> </p>
<p> Wayland <strong></strong></p>
<p></p>
<br />
<p>使</p>
<p>1. <strong>X11 (Xorg)</strong> </p>
<p>2. (WM/DE) </p>
<div className="agreement-overlay">
<div className="agreement-modal">
<div className="agreement-header">
<Shield size={32} />
<h2> (Wayland)</h2>
</div>
</div>
<div className="agreement-footer">
<div className="agreement-actions">
<button className="btn btn-primary" onClick={handleDismissWaylandWarning}></button>
<div className="agreement-content">
<div className="agreement-text">
<p>使 <strong>Wayland</strong> </p>
<p> Wayland <strong></strong></p>
<p></p>
<br />
<p>使</p>
<p>1. <strong>X11 (Xorg)</strong> </p>
<p>2. (WM/DE) </p>
</div>
</div>
<div className="agreement-footer">
<div className="agreement-actions">
<button className="btn btn-primary" onClick={handleDismissWaylandWarning}></button>
</div>
</div>
</div>
</div>
</div>
)}
{/* 更新提示对话框 */}

View File

@@ -2508,9 +2508,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
<div className="about-footer">
<p className="about-desc"></p>
<div className="about-links">
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://weflow.top') }}></a>
<span>·</span>
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://github.com/hicccc77/WeFlow') }}>GitHub </a>
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://github.com/hicccc77/WeFlow') }}></a>
<span>·</span>
<a href="#" onClick={(e) => { e.preventDefault(); window.electronAPI.shell.openExternal('https://chatlab.fun') }}>ChatLab</a>
<span>·</span>