Merge pull request #1275 from nextcloud/enh/noid/2nd-tab-warning

add 2nd tab warning
This commit is contained in:
Simon L 2022-10-24 20:38:45 +02:00 committed by GitHub
commit 3a29a55dc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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">
<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 isAnyRestarting = false %}
{% set isWatchtowerRunning = false %}