Skip to content

Commit 31d7e11

Browse files
authored
Fix calling toGMTString on lastModified (#277)
1 parent 4fe066c commit 31d7e11

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

source/background.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ async function scheduleNextAlarm(interval) {
2525
}
2626

2727
async function handleLastModified(newLastModified) {
28-
const lastModified = await localStore.get('lastModified') || new Date(0);
28+
const lastModified = await localStore.get('lastModified') || new Date(0).toUTCString();
2929

30-
// Something has changed since we last accessed, display any new notificaitons
30+
// Something has changed since we last accessed, display any new notifications
3131
if (newLastModified !== lastModified) {
3232
const {showDesktopNotif, playNotifSound} = await optionsStorage.getAll();
3333
if (showDesktopNotif === true || playNotifSound === true) {

source/lib/api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export async function getNotificationCount() {
126126
const {headers, json: notifications} = await getNotificationResponse({maxItems: 1});
127127

128128
const interval = Number(headers.get('X-Poll-Interval'));
129-
const lastModified = (new Date(headers.get('Last-Modified'))).toGMTString();
129+
const lastModified = (new Date(headers.get('Last-Modified'))).toUTCString();
130130
const linkHeader = headers.get('Link');
131131

132132
if (linkHeader === null) {

source/lib/notifications-service.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function playNotificationSound() {
125125
}
126126

127127
export async function checkNotifications(lastModified) {
128-
let notifications = await getNotifications({lastModified: lastModified.toGMTString()});
128+
let notifications = await getNotifications({lastModified});
129129
const {showDesktopNotif, playNotifSound, filterNotifications} = await optionsStorage.getAll();
130130

131131
if (filterNotifications) {

0 commit comments

Comments
 (0)