c1e7c5e90c
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>
22 lines
405 B
TypeScript
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
|
|
}
|