1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-21 14:47:41 +01:00

Extension should only be classed as active/valid when it's allowed on the domain

This commit is contained in:
William Oldham 2024-01-20 17:59:18 +00:00
parent ff045c95c7
commit 1918aa6d9b
2 changed files with 3 additions and 4 deletions

View file

@ -67,5 +67,5 @@ export async function isExtensionActive(): Promise<boolean> {
if (!info?.success) return false;
const allowedVersion = isAllowedExtensionVersion(info.version);
if (!allowedVersion) return false;
return true;
return info.allowed && info.hasPermission;
}

View file

@ -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