modify publick curriculum

This commit is contained in:
2026-07-07 16:12:30 +09:00
parent 9a1eec48e9
commit f0df24ecaa
8 changed files with 134 additions and 38 deletions
+24 -1
View File
@@ -12,6 +12,9 @@ import https from 'https'
let mainWindow: BrowserWindow | null = null
let splashWindow: BrowserWindow | null = null
const MIN_SPLASH_VISIBLE_MS = 2000
let splashVisibleStartedAt = 0
let splashCloseTimer: NodeJS.Timeout | null = null
const terminalProcesses = new Map<string, ChildProcessWithoutNullStreams>()
const terminalStopTimers = new Map<string, NodeJS.Timeout>()
const intentionalTerminalStops = new Set<string>()
@@ -3176,8 +3179,16 @@ function createSplashWindow(): void {
}
})
splashWindow.once('ready-to-show', () => splashWindow?.show())
splashVisibleStartedAt = Date.now()
splashWindow.once('ready-to-show', () => {
splashVisibleStartedAt = Date.now()
splashWindow?.show()
})
splashWindow.on('closed', () => {
if (splashCloseTimer) {
clearTimeout(splashCloseTimer)
splashCloseTimer = null
}
splashWindow = null
})
splashWindow.loadFile(join(__dirname, '../renderer/splash.html')).catch((error) => {
@@ -3194,6 +3205,18 @@ function updateSplashStatus(message: string): void {
}
function closeSplashAndShowMain(): void {
if (splashCloseTimer) return
const elapsed = splashVisibleStartedAt ? Date.now() - splashVisibleStartedAt : MIN_SPLASH_VISIBLE_MS
const remaining = Math.max(0, MIN_SPLASH_VISIBLE_MS - elapsed)
if (remaining > 0) {
splashCloseTimer = setTimeout(() => {
splashCloseTimer = null
closeSplashAndShowMain()
}, remaining)
return
}
if (mainWindow && !mainWindow.isDestroyed() && !mainWindow.isVisible()) {
splashWindow?.close()
splashWindow = null