kevinfiol / enhanced-gog

userscript to enhance the GOG experience.
MIT License
38 stars 5 forks source link

Script storage resets on every reload #14

Closed jarikmarwede closed 4 months ago

jarikmarwede commented 4 months ago

Hello, thanks for writing this script. I am having the problem that I want to select the prices to be shown in euros. Selecting Germany as the region works fine, and the price is displayed correctly. However, if I reload the site, the region is reset to US and US dollars are shown again.

From a quick look at the code, it seems like this line is the problem. If the collapsed value is set to false the entire condition evaluates to false and the else-block is executed, which resets the settings to default.
https://github.com/kevinfiol/enhanced-gog/blame/ca5fdb08302b184bc93279eae179948e932a26db/src/index.js#L93

kevinfiol commented 4 months ago

@jarikmarwede Thank you for opening the issue and finding the root cause.

I pushed up an update (1.5.1) that should fix this.