Skip to content

Commit

Permalink
fix: Adust menu button logic for Nextcloud 30 changes
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
  • Loading branch information
susnux committed Aug 6, 2024
1 parent 5692209 commit 7318668
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/app-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import 'vite/modulepreload-polyfill'
* Handle adding the first-run-wizard as an app menu entry
*/
document.addEventListener('DOMContentLoaded', function() {
const aboutEntry = document.querySelector('#firstrunwizard_about button')
const aboutEntry = () => document.querySelector('#firstrunwizard_about')

const addListener = () => {
const aboutEntry = document.querySelector('#firstrunwizard_about button')

aboutEntry.addEventListener('click', async function(event) {
aboutEntry().addEventListener('click', async function(event) {
event.stopPropagation()
event.preventDefault()
const focusReturn = document.querySelector('[aria-controls="header-menu-user-menu"]') ?? undefined
Expand All @@ -25,7 +23,7 @@ document.addEventListener('DOMContentLoaded', function() {
})
}

if (aboutEntry) {
if (aboutEntry()) {
addListener()
} else {
window._nc_event_bus.subscribe('core:user-menu:mounted', addListener)
Expand Down

0 comments on commit 7318668

Please sign in to comment.