Skip to content

Commit d3dd403

Browse files
committed
fix: add logout button to welcome screen
- allows to re-auth in case Network Error persists Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 445c56a commit d3dd403

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ app.whenReady().then(async () => {
313313
})
314314

315315
ipcMain.handle('authentication:logout', async (event) => {
316-
if (createMainWindow === createTalkWindow) {
316+
if (createMainWindow === createTalkWindow || createMainWindow === createWelcomeWindow) {
317317
await mainWindow.webContents.session.clearStorageData()
318318
const authenticationWindow = createAuthenticationWindow()
319319
createMainWindow = createAuthenticationWindow

src/welcome/welcome.html

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,36 @@
2828
display: none;
2929
}
3030

31-
.quit {
31+
.button {
3232
-webkit-app-region: no-drag;
33-
position: fixed;
34-
inset-block-start: 4px;
35-
inset-inline-end: 4px;
3633
width: 44px;
3734
height: 44px;
3835
border: none;
39-
background: transparent var(--original-icon-close-white) no-repeat center;
36+
border-radius: 8px;
37+
background-color: transparent;
38+
background-repeat: no-repeat;
39+
background-position: center;
4040
background-size: 20px;
4141
cursor: pointer;
42+
transition: background-color 0.3s;
43+
}
44+
45+
.button:hover {
46+
background-color: rgba(0, 0, 0, 0.2);
47+
}
48+
49+
.quit {
50+
position: fixed;
51+
inset-block-start: 4px;
52+
inset-inline-end: 4px;
53+
background-image: var(--original-icon-close-white);
54+
}
55+
56+
.logout {
57+
position: fixed;
58+
inset-block-start: 4px;
59+
inset-inline-end: calc(4px + 4px + 44px);
60+
background-image: var(--original-icon-logout-white);
4261
}
4362

4463
.quit_mac {
@@ -123,7 +142,8 @@
123142
<title>Nextcloud Talk</title>
124143
</head>
125144
<body>
126-
<button class="quit hidden" aria-label="Quit" type="button"></button>
145+
<button class="button logout hidden" aria-label="Log out" title="Log out" type="button"></button>
146+
<button class="button quit hidden" aria-label="Quit" title="Quit" type="button"></button>
127147
<div class="wrapper">
128148
<div class="spacer"></div>
129149
<div class="logo"></div>

src/welcome/welcome.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import { applyAxiosInterceptors } from '../shared/setupWebPage.js'
1313
const quitButton = document.querySelector('.quit')
1414
quitButton.addEventListener('click', () => window.TALK_DESKTOP.quit())
1515

16+
const logoutButton = document.querySelector('.logout')
17+
logoutButton.addEventListener('click', () => window.TALK_DESKTOP.logout())
18+
1619
window.TALK_DESKTOP.getSystemInfo().then(os => {
1720
quitButton.classList.remove('hidden')
1821
if (os.isMac) {
@@ -26,6 +29,7 @@ initGlobals()
2629
applyAxiosInterceptors()
2730

2831
if (appData.credentials) {
32+
logoutButton.classList.remove('hidden')
2933
await window.TALK_DESKTOP.enableWebRequestInterceptor(appData.serverUrl, { enableCors: true, enableCookies: true, credentials: appData.credentials })
3034
await refetchAppDataIfDirty(appData)
3135
}

0 commit comments

Comments
 (0)