Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define var before $script.ready #2388

Closed
yasarjames opened this issue Apr 30, 2023 · 2 comments
Closed

Define var before $script.ready #2388

yasarjames opened this issue Apr 30, 2023 · 2 comments

Comments

@yasarjames
Copy link

In omega-web/src/popup/js/profiles.js, need to define vars before $script.ready otherwise will get error when run updateMenuByState

function updateMenuByState() {
  ...
  addProfilesItems(state);
  ...
}

function addProfilesItems(state) {
  ...
  var profiles = Object.keys(state.availableProfiles).map(function (key) {
    return state.availableProfiles[key];
  }).sort(compareProfile);
  ...
}

function compareProfile(a, b) {
  var diff;
  diff = (orderForType[a.profileType] | 0) - (orderForType[b.profileType] | 0); // get error that orderForType is undefined here
  ...
}

which will lead to empty list.

@yasarjames
Copy link
Author

#2342

@AnyWAT
Copy link

AnyWAT commented Sep 13, 2024

#2513 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants