OdyseeTeam / odysee-frontend

The code that runs odysee.com
https://odysee.com
MIT License
209 stars 65 forks source link

Fix blank hometab sections on channel with 0 views #3099

Closed keikari closed 3 months ago

keikari commented 3 months ago

Fixes

If channel has no views, and creator settings for any channels haven't been loaded, the homepage sections don't get set to default, and are left blank.

Fix: If there is error loading settings for some channel, and the settings aren't loaded from before, create an empty entry for the channel. This allows the default settings to be loaded.

Screenshot of the error case ![2024-05-17_14-19](https://github.com/OdyseeTeam/odysee-frontend/assets/34790748/9e2eea1f-453a-4ea4-aeb0-ba9cf71b0ca9)
tzarebczan commented 3 months ago

Thanks, this one was super annoying!

What happens if the call fails and there are settings, would it overwrite them?

keikari commented 3 months ago

No, if the settings exist already, it won't set it to undefined

keikari commented 3 months ago

And looks like settings.Update only updates the specific settings, and doesn't do the update with the whole front end version of settings. (And even if it did, I don't think this would make difference to current version)