mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-01 18:32:27 +00:00
Update NIP-07 signer hydration
This commit is contained in:
1 parent
36e96306f5
commit
2a0a0a0427
1 file changed
+14
-1
+14
-1
@@ -323,7 +323,12 @@ function resolveSignerCapabilities(signer) {
|
||||
}
|
||||
|
||||
function hydrateExtensionSignerCapabilities(signer) {
|
||||
if (!signer || typeof signer !== "object" || signer.type !== "extension") {
|
||||
if (!signer || typeof signer !== "object") {
|
||||
return;
|
||||
}
|
||||
|
||||
const signerType = typeof signer.type === "string" ? signer.type : "";
|
||||
if (signerType !== "extension" && signerType !== "nip07") {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -371,6 +376,10 @@ function setActiveSigner(signer) {
|
||||
function getActiveSigner() {
|
||||
const signer = getActiveSignerFromRegistry();
|
||||
hydrateExtensionSignerCapabilities(signer);
|
||||
attachNipMethodAliases(signer);
|
||||
if (signer && typeof signer === "object") {
|
||||
signer.capabilities = resolveSignerCapabilities(signer);
|
||||
}
|
||||
return signer;
|
||||
}
|
||||
|
||||
@@ -385,6 +394,10 @@ function logoutSigner(pubkey) {
|
||||
function resolveActiveSigner(pubkey) {
|
||||
const signer = resolveActiveSignerFromRegistry(pubkey);
|
||||
hydrateExtensionSignerCapabilities(signer);
|
||||
attachNipMethodAliases(signer);
|
||||
if (signer && typeof signer === "object") {
|
||||
signer.capabilities = resolveSignerCapabilities(signer);
|
||||
}
|
||||
return signer;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user