Files
geo/apps/desktop-client/src/main/single-instance.ts
T
root c1e7c5e90c feat(publish): add tenant publish management with desktop deep-link
Expose tenant-authenticated publish task list and retry endpoints so the
admin web can show desktop publish state without an Electron bridge, and
register a `shengxintui://` deep-link so the page can hand off to the
desktop client workbench.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 12:07:28 +08:00

22 lines
405 B
TypeScript

import { app } from 'electron/main'
let initialized = false
export function initSingleInstance(onSecondInstance?: (argv: string[]) => void): boolean {
if (initialized) {
return true
}
initialized = true
const hasLock = app.requestSingleInstanceLock()
if (!hasLock) {
return false
}
app.on('second-instance', (_event, argv) => {
onSecondInstance?.(argv)
})
return true
}