-
Notifications
You must be signed in to change notification settings - Fork 187
Conversation
@@ -51,6 +51,7 @@ export default class extends Model { | |||
listingsGridViewType: 'grid', | |||
bitcoinUnit: 'BTC', | |||
verifiedModsProvider: 'https://search.ob1.io/verified_moderators', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea that if the provider doesn't provide a seperate tor url, the standard url will be filled in for both urls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? When we add the ability to put in a custom endpoint, we'd have to handle that situation.
If a user just put in a clearnet endpoint, we could either:
a. set the Tor endpoint to that url
b. fall back to the clear endpoint in the verifiedMods collection if the Tor endpoint is missing
c. not load verified mods at all if the user in is Tor mode and doesn't have a Tor endpoint
I think that's something we'll have to figure out when planning the feature to edit your endpoints.
js/collections/VerifiedMods.js
Outdated
@@ -18,7 +19,8 @@ export default class extends Collection { | |||
} | |||
|
|||
url() { | |||
return app.localSettings.get('verifiedModsProvider'); | |||
const usingTor = app.serverConfig.tor && getCurrentConnection().server.get('useTor'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could eliminate the app.serverConfig.tor
part there since it doesn't really matter if the server is using tor or not because this call wouldn't go through the server. getCurrentConnection().server.get('useTor')
indicates that the user chose to use tor in their server config and that IMHO should be enough for us to route the verified mods call through a tor endpoint.
js/collections/VerifiedMods.js
Outdated
@@ -18,7 +19,7 @@ export default class extends Collection { | |||
} | |||
|
|||
url() { | |||
return app.localSettings.get('verifiedModsProvider'); | |||
return app.localSettings.get(`verifiedModsProvider${getCurrentConnection().server.get('useTor') ? 'Tor' : ''}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line too long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is. I switched editors and didn't notice it had linting turned off and a different line length.
If the app is in Tor mode, use the new Tor endpoint for the verified moderators.
Closes #1275