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

Graphics: uBlock Origin breaks GeoIP locator #61

Open
Weihua4455 opened this issue Aug 26, 2022 · 1 comment
Open

Graphics: uBlock Origin breaks GeoIP locator #61

Weihua4455 opened this issue Aug 26, 2022 · 1 comment

Comments

@Weihua4455
Copy link
Collaborator

No description provided.

@Weihua4455
Copy link
Collaborator Author

So right now my solution is handling this in the Randousel component.

First, we assign an index based on the promised geolocation:

selectedIndex = data.findIndex(d => d.state === locationResponse.region);

And we have this that tells the Randousel to start from the first one if selectIndex is undefined:

  $: if (count === 0) {
    if (data[selectedIndex]) {
      selectedWTF = data[selectedIndex]
    } else {
      selectedWTF = data.filter(d => +d.rank === 1)[0]
    }
  } else {
    selectedWTF = data.filter(d => +d.rank === count)[0]
  }

I tried to recreate the uBlock error on my machine, and this seems to fix it. I'm sure it's not the best solution though. Cc @rdmurphy to brainstorm more!

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

No branches or pull requests

1 participant