SwitchyOmega
SwitchyOmega copied to clipboard
Fix popup show no profile
What does this PR do?
- [x] Bug fix [#2337]
- [ ] Improvement
- [ ] New feature
(Note: Translations and typo fixes should be done on https://hosted.weblate.org/projects/switchyomega/ instead of PR.)
In some case there may be no profile shown in popup menu like
And we can find error like this
Uncaught TypeError: Cannot read properties of undefined (reading 'FixedProfile')
at compareProfile (profiles.js:43:25)
at Array.sort (<anonymous>)
at addProfilesItems (profiles.js:145:8)
at updateMenuByState (profiles.js:36:5)
at v.ready (script.min.js:formatted:95:14)
at profiles.js:2:11
at profiles.js:283:3
Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var#var_hoisting
Compatibility
- Is this PR compatible with old versions? Y
- Can users simply upgrade the extension? Y