Skip to content

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)

Signed-off-by: Adam Setch <adam.setch@outlook.com>
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants