mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 16:32:28 +00:00
feat: show provider metadata in saved profiles
This commit is contained in:
1 parent
3532c212f3
commit
6d84d6be4e
8 files changed
+362
-29
No files matched your search
@@ -2085,6 +2085,20 @@ class Application {
|
||||
return "nip07";
|
||||
})();
|
||||
|
||||
const resolvedProviderId = (() => {
|
||||
const candidates = [detailProviderId, providerId, resolvedAuthType];
|
||||
for (const candidate of candidates) {
|
||||
if (typeof candidate !== "string") {
|
||||
continue;
|
||||
}
|
||||
const trimmed = candidate.trim();
|
||||
if (trimmed) {
|
||||
return trimmed;
|
||||
}
|
||||
}
|
||||
return resolvedAuthType;
|
||||
})();
|
||||
|
||||
const normalizedPubkey = this.normalizeHexPubkey(pubkey);
|
||||
if (!normalizedPubkey) {
|
||||
throw new Error(
|
||||
@@ -2119,6 +2133,7 @@ class Application {
|
||||
name,
|
||||
picture,
|
||||
authType: resolvedAuthType,
|
||||
providerId: resolvedProviderId,
|
||||
});
|
||||
|
||||
persistSavedProfiles({ persistActive: false });
|
||||
@@ -2955,12 +2970,12 @@ class Application {
|
||||
}
|
||||
}
|
||||
|
||||
async handleProfileSwitchRequest({ pubkey } = {}) {
|
||||
async handleProfileSwitchRequest({ pubkey, providerId } = {}) {
|
||||
if (!pubkey) {
|
||||
throw new Error("Missing pubkey for profile switch request.");
|
||||
}
|
||||
|
||||
const result = await this.authService.switchProfile(pubkey);
|
||||
const result = await this.authService.switchProfile(pubkey, { providerId });
|
||||
|
||||
if (result?.switched) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user