Add media server selection to Nostr settings
Also, hide the fallback option when there's no server to fall back to
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
uniqNormalizedRelays,
|
||||
} from '../utils/nostr';
|
||||
import { getGeohashPrefixesInBbox } from '../utils/geohash-coverage';
|
||||
import { DEFAULT_BLOSSOM_SERVER } from './blossom';
|
||||
|
||||
const DIRECTORY_RELAYS = [
|
||||
'wss://relay.primal.net',
|
||||
@@ -437,6 +438,16 @@ export default class NostrDataService extends Service {
|
||||
} else {
|
||||
this.blossomServers = [];
|
||||
}
|
||||
|
||||
if (this.blossomServers.length > 0) {
|
||||
const current = this.settings.nostrMediaServer;
|
||||
if (
|
||||
current === DEFAULT_BLOSSOM_SERVER ||
|
||||
!this.blossomServers.includes(current)
|
||||
) {
|
||||
this.settings.update('nostrMediaServer', this.blossomServers[0]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 1. Await cache initialization and populate the EventStore with local data
|
||||
|
||||
Reference in New Issue
Block a user