force launcher restart after update
This commit is contained in:
+15
-2
@@ -775,8 +775,21 @@ function createWindow(): void {
|
|||||||
await installDebPackage(debPath)
|
await installDebPackage(debPath)
|
||||||
|
|
||||||
if (!is.dev) {
|
if (!is.dev) {
|
||||||
app.relaunch()
|
for (const child of appProcesses.values()) {
|
||||||
app.quit()
|
child.kill()
|
||||||
|
}
|
||||||
|
appProcesses.clear()
|
||||||
|
|
||||||
|
for (const win of appWindows.values()) {
|
||||||
|
if (!win.isDestroyed()) win.close()
|
||||||
|
}
|
||||||
|
appWindows.clear()
|
||||||
|
|
||||||
|
setImmediate(() => {
|
||||||
|
app.relaunch()
|
||||||
|
app.quit()
|
||||||
|
setTimeout(() => app.exit(0), 1000)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -630,7 +630,7 @@ body,
|
|||||||
|
|
||||||
.launcher-version-wrap {
|
.launcher-version-wrap {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 24px;
|
left: 24px;
|
||||||
bottom: 16px;
|
bottom: 16px;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -638,6 +638,22 @@ body,
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-version-wrap {
|
||||||
|
position: absolute;
|
||||||
|
right: 24px;
|
||||||
|
bottom: 16px;
|
||||||
|
z-index: 5;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
max-width: min(360px, 42vw);
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-version-wrap .version-label {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.launcher-update-text {
|
.launcher-update-text {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -107,6 +107,9 @@ function Dashboard({ authSession, onSessionUpdate, onLogout }: DashboardProps):
|
|||||||
: launcherStatus
|
: launcherStatus
|
||||||
? '최신버전'
|
? '최신버전'
|
||||||
: '업데이트 상태 확인중'
|
: '업데이트 상태 확인중'
|
||||||
|
const activeAppVersion = activeApp
|
||||||
|
? activeLocalVersion ?? appStatus?.localVersion ?? appStatus?.latestVersion ?? null
|
||||||
|
: null
|
||||||
|
|
||||||
const refreshSession = useCallback(async (): Promise<AuthSession | null> => {
|
const refreshSession = useCallback(async (): Promise<AuthSession | null> => {
|
||||||
const response = await fetch(`${LAUNCHER_API_BASE_URL}/api/auth/refresh`, {
|
const response = await fetch(`${LAUNCHER_API_BASE_URL}/api/auth/refresh`, {
|
||||||
@@ -737,19 +740,26 @@ function Dashboard({ authSession, onSessionUpdate, onLogout }: DashboardProps):
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{!showManual && (
|
{!showManual && (
|
||||||
<div className="launcher-version-wrap">
|
<>
|
||||||
{launcherUpdateAvailable && (
|
<div className="launcher-version-wrap">
|
||||||
<button
|
{launcherUpdateAvailable && (
|
||||||
type="button"
|
<button
|
||||||
className="launcher-update-text"
|
type="button"
|
||||||
onClick={() => handleUpdate('launcher', launcherStatus.latestVersion, launcherStatus.downloadUrl)}
|
className="launcher-update-text"
|
||||||
disabled={hasAnyUpdatingApp}
|
onClick={() => handleUpdate('launcher', launcherStatus.latestVersion, launcherStatus.downloadUrl)}
|
||||||
>
|
disabled={hasAnyUpdatingApp}
|
||||||
업데이트
|
>
|
||||||
</button>
|
업데이트
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
<div className="version-label">Launcher v{localVersions.launcher ?? version}</div>
|
||||||
|
</div>
|
||||||
|
{activeAppVersion && (
|
||||||
|
<div className="app-version-wrap">
|
||||||
|
<div className="version-label">{appConfig?.displayName ?? activeApp} v{activeAppVersion}</div>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="version-label">v{localVersions.launcher ?? version}</div>
|
</>
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user