Merge branch 'unstable' into agent/automated-pr-review-fixes-3637557005884121646

This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-01-31 13:48:46 -05:00
commit daa9161f96
36 files changed
+1208 -990

No files matched your search

+11 -18
View File
@@ -908,24 +908,16 @@ class HashtagPreferencesService {
DEFAULT_NIP07_ENCRYPTION_METHODS,
);
if (!permissionResult?.ok) {
const error =
permissionResult?.error instanceof Error
? permissionResult.error
: new Error(
"Extension encryption permissions are required to read hashtag preferences.",
);
error.code = "hashtag-preferences-permission-required";
return { ok: false, error };
userLogger.warn(
`${LOG_PREFIX} Extension permission request failed/denied, but attempting operation via fallback.`,
permissionResult?.error,
);
}
} catch (error) {
userLogger.warn(
`${LOG_PREFIX} Extension permissions request failed while loading preferences`,
`${LOG_PREFIX} Extension permissions request threw, attempting fallback.`,
error,
);
const wrapped =
error instanceof Error ? error : new Error(String(error));
wrapped.code = "hashtag-preferences-permission-required";
return { ok: false, error: wrapped };
}
}
@@ -969,11 +961,12 @@ class HashtagPreferencesService {
);
}
const nostrApi = allowPermissionPrompt
? typeof window !== "undefined"
? window?.nostr
: null
: null;
const nostrApi =
typeof window !== "undefined" && window?.nostr
? window.nostr
: typeof globalThis !== "undefined" && globalThis?.nostr
? globalThis.nostr
: null;
if (nostrApi) {
if (typeof nostrApi.nip04?.decrypt === "function") {
registerDecryptor(