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:
parent
ff045c95c7
commit
1918aa6d9b
2 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue