Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix calling toGMTString on lastModified #277

Merged
merged 1 commit into from
Mar 5, 2023

Conversation

mabrikan
Copy link
Contributor

@mabrikan mabrikan commented Mar 4, 2023

This fixes #276.

Function checkNotifications is always passed a string value for lastModified (unless, localStore is empty, in which case a Date object is created), so calling toGMTString() resulted in an error.

This change does the following:

  1. Fix the bug by removing unneeded toGMTString() call
  2. make sure lastModified is always a string, even when localStore is empty
  3. Use toUTCString() as it is more consistent with how JS interprets time.

@mabrikan mabrikan changed the title Fixes #276: Fix calling toGMTString on lastModified Fix calling toGMTString on lastModified Mar 4, 2023
@notlmn notlmn merged commit 31d7e11 into sindresorhus:main Mar 5, 2023
@notlmn
Copy link
Collaborator

notlmn commented Mar 5, 2023

Thank you 🙌

@mabrikan
Copy link
Contributor Author

mabrikan commented Mar 6, 2023

You're most welcome.

@mabrikan mabrikan deleted the fix-lastmodified-string-to-date branch March 6, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Desktop notifications are not sent
2 participants