mirror of
https://github.com/movie-web/movie-web.git
synced 2025-02-28 23:03:37 +01:00
Extension should only be classed as active/valid when it's allowed on the domain
This commit is contained in:
parent
ff045c95c7
commit
1918aa6d9b
@ -67,5 +67,5 @@ export async function isExtensionActive(): Promise<boolean> {
|
|||||||
if (!info?.success) return false;
|
if (!info?.success) return false;
|
||||||
const allowedVersion = isAllowedExtensionVersion(info.version);
|
const allowedVersion = isAllowedExtensionVersion(info.version);
|
||||||
if (!allowedVersion) return false;
|
if (!allowedVersion) return false;
|
||||||
return true;
|
return info.allowed && info.hasPermission;
|
||||||
}
|
}
|
||||||
|
@ -46,11 +46,10 @@ export function MetaPart(props: MetaPartProps) {
|
|||||||
const { error, value, loading } = useAsync(async () => {
|
const { error, value, loading } = useAsync(async () => {
|
||||||
const info = await extensionInfo();
|
const info = await extensionInfo();
|
||||||
const isValidExtension =
|
const isValidExtension =
|
||||||
info?.success && isAllowedExtensionVersion(info.version);
|
info?.success && isAllowedExtensionVersion(info.version) && info.allowed;
|
||||||
|
|
||||||
if (isValidExtension) {
|
if (isValidExtension) {
|
||||||
if (!info.allowed || !info.hasPermission)
|
if (!info.hasPermission) throw new Error("extension-no-permission");
|
||||||
throw new Error("extension-no-permission");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// use api metadata or providers metadata
|
// use api metadata or providers metadata
|
||||||
|
Loading…
x
Reference in New Issue
Block a user