Refactor settings menu, add Nostr settings

Adds a setting to control if photos should be uploaded only to the
main/default server, or all known servers of a user.

Only upload to the main server by default, to speed up adding photos.
This commit is contained in:
2026-04-21 14:39:24 +04:00
parent 54ba99673f
commit 5bd4dba907
6 changed files with 241 additions and 160 deletions

View File

@@ -21,10 +21,17 @@ function getBlossomUrl(serverUrl, path) {
export default class BlossomService extends Service {
@service nostrAuth;
@service nostrData;
@service settings;
get servers() {
const servers = this.nostrData.blossomServers;
return servers.length ? servers : [DEFAULT_BLOSSOM_SERVER];
const allServers = servers.length ? servers : [DEFAULT_BLOSSOM_SERVER];
if (!this.settings.nostrPhotoFallbackUploads) {
return [allServers[0]];
}
return allServers;
}
async _getAuthHeader(action, hash, serverUrl) {