Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add logout button to welcome screen #1012

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ app.whenReady().then(async () => {
})

ipcMain.handle('authentication:logout', async (event) => {
if (createMainWindow === createTalkWindow) {
if (createMainWindow === createTalkWindow || createMainWindow === createWelcomeWindow) {
await mainWindow.webContents.session.clearStorageData()
const authenticationWindow = createAuthenticationWindow()
createMainWindow = createAuthenticationWindow
Expand Down
32 changes: 26 additions & 6 deletions src/welcome/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,36 @@
display: none;
}

.quit {
.button {
-webkit-app-region: no-drag;
position: fixed;
inset-block-start: 4px;
inset-inline-end: 4px;
width: 44px;
height: 44px;
border: none;
background: transparent var(--original-icon-close-white) no-repeat center;
border-radius: 8px;
background-color: transparent;
background-repeat: no-repeat;
background-position: center;
background-size: 20px;
cursor: pointer;
transition: background-color 0.3s;
}

.button:hover {
background-color: rgba(0, 0, 0, 0.2);
}

.quit {
position: fixed;
inset-block-start: 4px;
inset-inline-end: 4px;
background-image: var(--original-icon-close-white);
}

.logout {
position: fixed;
inset-block-start: 4px;
inset-inline-end: calc(4px + 4px + 44px);
background-image: var(--original-icon-logout-white);
}

.quit_mac {
Expand Down Expand Up @@ -123,7 +142,8 @@
<title>Nextcloud Talk</title>
</head>
<body>
<button class="quit hidden" aria-label="Quit" type="button"></button>
<button class="button logout hidden" aria-label="Log out" title="Log out" type="button"></button>
<button class="button quit hidden" aria-label="Quit" title="Quit" type="button"></button>
<div class="wrapper">
<div class="spacer"></div>
<div class="logo"></div>
Expand Down
4 changes: 4 additions & 0 deletions src/welcome/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import { applyAxiosInterceptors } from '../shared/setupWebPage.js'
const quitButton = document.querySelector('.quit')
quitButton.addEventListener('click', () => window.TALK_DESKTOP.quit())

const logoutButton = document.querySelector('.logout')
logoutButton.addEventListener('click', () => window.TALK_DESKTOP.logout())

window.TALK_DESKTOP.getSystemInfo().then(os => {
quitButton.classList.remove('hidden')
if (os.isMac) {
Expand All @@ -26,6 +29,7 @@ initGlobals()
applyAxiosInterceptors()

if (appData.credentials) {
logoutButton.classList.remove('hidden')
await window.TALK_DESKTOP.enableWebRequestInterceptor(appData.serverUrl, { enableCors: true, enableCookies: true, credentials: appData.credentials })
await refetchAppDataIfDirty(appData)
}
Expand Down
Loading