cerebroapp / cerebro

🔵 Cerebro is an open-source launcher to improve your productivity and efficiency
https://www.cerebroapp.com/
MIT License
8.33k stars 455 forks source link

fix: Fix plugin settings #627

Closed ChFlick closed 1 year ago

ChFlick commented 1 year ago

Fixes #626

The main problem was that

config.set('plugins', {
  ...config.get('plugins'),
  [name]: values,
})

was called before the value of values was updated. Solution: moved it to useEffect with the dependency of values.

Furthermore, the dropdown settings weren't rendered correctly as the Select Component expects one of the options as its value (like { label: 'string', value: 'string' }) and not just a string. So when a string option is used, find the corresponding option.