From 1918aa6d9b66e274a76bbee4613340c54102d2a1 Mon Sep 17 00:00:00 2001 From: William Oldham Date: Sat, 20 Jan 2024 17:59:18 +0000 Subject: [PATCH] Extension should only be classed as active/valid when it's allowed on the domain --- src/backend/extension/messaging.ts | 2 +- src/pages/parts/player/MetaPart.tsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/backend/extension/messaging.ts b/src/backend/extension/messaging.ts index b738184a..1f2a2b00 100644 --- a/src/backend/extension/messaging.ts +++ b/src/backend/extension/messaging.ts @@ -67,5 +67,5 @@ export async function isExtensionActive(): Promise { if (!info?.success) return false; const allowedVersion = isAllowedExtensionVersion(info.version); if (!allowedVersion) return false; - return true; + return info.allowed && info.hasPermission; } diff --git a/src/pages/parts/player/MetaPart.tsx b/src/pages/parts/player/MetaPart.tsx index 1e18b6d1..17803219 100644 --- a/src/pages/parts/player/MetaPart.tsx +++ b/src/pages/parts/player/MetaPart.tsx @@ -46,11 +46,10 @@ export function MetaPart(props: MetaPartProps) { const { error, value, loading } = useAsync(async () => { const info = await extensionInfo(); const isValidExtension = - info?.success && isAllowedExtensionVersion(info.version); + info?.success && isAllowedExtensionVersion(info.version) && info.allowed; if (isValidExtension) { - if (!info.allowed || !info.hasPermission) - throw new Error("extension-no-permission"); + if (!info.hasPermission) throw new Error("extension-no-permission"); } // use api metadata or providers metadata