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: openLinks on first login screen #1451

Merged
merged 2 commits into from
Aug 9, 2024
Merged

Conversation

shiron-dev
Copy link
Contributor

There was a bug that the "Create new OAuth App" button did not respond when pressing it to login again after deleting data.

This happens because loadState() is executed when opening the link, but once the data is deleted, localStorage becomes empty and loadState() returns null.
So I fixed this bug by saving the defalut states (defaultAuth and defaultSettings) when localStorage is empty.

After starting the app with pnpm start and then pressing the "Create new OAuth App" button, the error displayed was as follows

[44950:0809/151522.895514:INFO:CONSOLE(2)] "Uncaught TypeError: Cannot read properties of undefined (reading 'openLinks')", source: file:///Users/shiron/projects/gitify/build/js/app.js (2)

@setchy
Copy link
Member

setchy commented Aug 9, 2024

Thanks @shiron-dev for reporting this and raising a fix.

I've taken your approach and moved it into our storage loadState function to ensure we always get a valid state

@setchy setchy added this to the Release 5.13.0 milestone Aug 9, 2024
@setchy setchy added the bug Something isn't working label Aug 9, 2024
@setchy setchy merged commit e197589 into gitify-app:main Aug 9, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants