mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-02 06:26:27 -04:00
fix helpers storage
This commit is contained in:
parent
835237382f
commit
fd890f9c0a
3 changed files with 20 additions and 22 deletions
|
@ -48,7 +48,7 @@ function create_notification_stream(subscriptions) {
|
|||
}
|
||||
|
||||
delivered.push(notification.videoId);
|
||||
helpers.storage.set('notification_count', parseInt(helpers.storage.get('notification_count') || '0') + 1);
|
||||
helpers.storage.set('notification_count', (helpers.storage.get('notification_count') || 0) + 1);
|
||||
var notification_ticker = document.getElementById('notification_ticker');
|
||||
|
||||
if (parseInt(helpers.storage.get('notification_count')) > 0) {
|
||||
|
@ -72,7 +72,12 @@ function handle_notification_error(event) {
|
|||
}
|
||||
|
||||
addEventListener('load', function (e) {
|
||||
helpers.storage.set('notification_count', document.getElementById('notification_count') ? document.getElementById('notification_count').innerText : '0');
|
||||
var notification_count = document.getElementById('notification_count');
|
||||
if (notification_count) {
|
||||
helpers.storage.set('notification_count', parseInt(notification_count.innerText));
|
||||
} else {
|
||||
helpers.storage.set('notification_count', 0);
|
||||
}
|
||||
|
||||
if (helpers.storage.get('stream')) {
|
||||
helpers.storage.remove('stream');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue