add 2nd tab warning

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-10-16 18:23:27 +02:00
parent 9d4c591f1a
commit 3ac260837f
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,12 @@
const channel = new BroadcastChannel('tab')
channel.postMessage('second-tab')
// note that listener is added after posting the message
channel.addEventListener('message', (msg) => {
if (msg.data === 'second-tab') {
// message received from 2nd tab
document.getElementById('overlay').classList.add('loading')
alert('Cannot open multiple instances. You can use AIO here by reloading the page.')
}
});

View file

@ -18,6 +18,9 @@
<div class="content"> <div class="content">
<h1>Nextcloud AIO v2.0.4</h1> <h1>Nextcloud AIO v2.0.4</h1>
{# Add 2nd tab warning #}
<script type="text/javascript" src="second-tab-warning.js"></script>
{% set isAnyRunning = false %} {% set isAnyRunning = false %}
{% set isAnyRestarting = false %} {% set isAnyRestarting = false %}
{% set isWatchtowerRunning = false %} {% set isWatchtowerRunning = false %}