Skip to content

Commit

Permalink
hotfix: disable region detection for legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Aug 5, 2024
1 parent 1299452 commit dd57d99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/components/relays/jobs/LoadSeed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ import { RelayPool } from 'nostr'
import { getAverageLatency, getMedianLatency, getMinLatency, getMaxLatency, RelayCheckerResult } from 'nostrwatch-js'
//PATCH: Old method for region aggregate is fragile and just wrong, patch to just use eu-west until new version
const REGION_STATIC = "eu-west";
const localMethods = {
LoadSeed(force, single){
if( (!this.isExpired(this.slug, 15*60*1000) && !force) )
Expand Down Expand Up @@ -115,8 +118,8 @@ const localMethods = {
connect: null,
read: null,
write: null,
latency: data?.latency[this.store.prefs.region]?.final ? true : false,
averageLatency: data?.latency[this.store.prefs.region]?.average ? true : false
latency: data?.latency[REGION_STATIC]?.final ? true : false,
averageLatency: data?.latency[REGION_STATIC]?.average ? true : false
},
}
Expand All @@ -125,7 +128,7 @@ const localMethods = {
if(data?.info)
result.info = data.info
const regionLatency = data?.latency?.[this.store.prefs.region]
const regionLatency = data?.latency?.[REGION_STATIC]
result.latency = {
average: regionLatency?.[1] ? getAverageLatency(regionLatency[1]) : null,
Expand Down
12 changes: 6 additions & 6 deletions src/components/relays/pages/UserPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</div>
</div>

<div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 dark:sm:border-slate-800 sm:pt-5">
<!--div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 dark:sm:border-slate-800 sm:pt-5">
<label for="about" class="block text-sm font-medium text-gray-700 dark:text-gray-300 sm:mt-px sm:pt-2">
Use realtime geo-checking
</label>
Expand All @@ -110,9 +110,9 @@
</Switch>
<p class="mt-2 text-sm text-gray-500">If disabled, geo-checking will use build-time data instead of API. Geo entires are very likely to be missing when this is disabled since this data is only updated periodically. Use this option if you use an ad-blocker or Brave Browser.</p>
</div>
</div>
</div-->

<div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 dark:sm:border-slate-800 sm:pt-5">
<!--div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 dark:sm:border-slate-800 sm:pt-5">
<label for="about" class="block text-sm font-medium text-gray-700 dark:text-gray-300 sm:mt-px sm:pt-2">
Auto-detect Region
</label>
Expand All @@ -131,9 +131,9 @@
</Switch>
<p class="mt-2 text-sm text-gray-500">If enabled, nostr.watch will use your IP to obtain geo-data and pick the best region for you.</p>
</div>
</div>
</div-->

<div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 dark:sm:border-slate-800 sm:pt-5" v-if="!store.prefs.autoDetectRegion">
<!--div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 dark:sm:border-slate-800 sm:pt-5" v-if="!store.prefs.autoDetectRegion">
<label for="about" class="block text-sm font-medium text-gray-700 dark:text-gray-300 sm:mt-px sm:pt-2">
Select region
</label>
Expand All @@ -145,7 +145,7 @@
</div>
<p class="mt-2 text-sm text-gray-500">The region determines where uptime<span v-if="!store.prefs.clientSideProcessing"> and latency</span> data is pulled from</p>
</div>
</div>
</div-->

<h2 class="text-2xl pt-8 text-gray-500 dark:text-white/50 mt-4 font-extrabold">Sorting</h2>
<div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-t sm:border-gray-200 dark:sm:border-slate-800 sm:pt-5">
Expand Down

0 comments on commit dd57d99

Please sign in to comment.