fix: Fix opening "Remote shares" dialog even if Notifications is available

The dialog is supposed to be shown only if the Notifications app is not
available, and to know whether it is available or not it is checked if
the header contains the Notifications button. However, in Nextcloud 25
the DOM of the Notifications app changed, so the button is no longer
found and thus the dialog was always shown when there are pending
shares.

Even if the correct element query was used the dialog may be still shown
anyway if "external.js" is loaded before the notifications button is
added to the header. Therefore now it is checked if the Notifications
app is available or not from the OC API.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2024-03-21 14:03:12 +01:00
parent 45e601f8f2
commit af773d5ce1

View file

@ -78,7 +78,7 @@
this.filesApp = filesApp;
this.processIncomingShareFromUrl();
if (!$('#header').find('div.notifications').length) {
if (!('notifications' in OC.appswebroots)) {
// No notification app, display the modal
this.processSharesToConfirm();
}