mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-04 08:17:24 -05:00
Check if stopwatch element empty (#15278)
This commit is contained in:
parent
16dea6cebd
commit
e10d028b03
@ -9,6 +9,11 @@ export async function initStopwatch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const stopwatchEl = $('.active-stopwatch-trigger');
|
const stopwatchEl = $('.active-stopwatch-trigger');
|
||||||
|
|
||||||
|
if (!stopwatchEl.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
stopwatchEl.removeAttr('href'); // intended for noscript mode only
|
stopwatchEl.removeAttr('href'); // intended for noscript mode only
|
||||||
stopwatchEl.popup({
|
stopwatchEl.popup({
|
||||||
position: 'bottom right',
|
position: 'bottom right',
|
||||||
@ -20,10 +25,6 @@ export async function initStopwatch() {
|
|||||||
$(this).parent().trigger('submit');
|
$(this).parent().trigger('submit');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!stopwatchEl) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NotificationSettings.EventSourceUpdateTime > 0 && !!window.EventSource && window.SharedWorker) {
|
if (NotificationSettings.EventSourceUpdateTime > 0 && !!window.EventSource && window.SharedWorker) {
|
||||||
// Try to connect to the event source via the shared worker first
|
// Try to connect to the event source via the shared worker first
|
||||||
const worker = new SharedWorker(`${__webpack_public_path__}js/eventsource.sharedworker.js`, 'notification-worker');
|
const worker = new SharedWorker(`${__webpack_public_path__}js/eventsource.sharedworker.js`, 'notification-worker');
|
||||||
|
Loading…
Reference in New Issue
Block a user