fix: Iframely is not correctly disabled with no API_KEY in env

closes #7147
This commit is contained in:
Tom Moor
2024-06-25 21:10:21 -04:00
parent 5c999f5327
commit bf2378ec81

View File

@@ -8,7 +8,12 @@ import env from "./env";
import Iframely from "./iframely";
const isDefaultHost = env.IFRAMELY_URL === Iframely.defaultUrl;
const enabled = (isDefaultHost && !!env.IFRAMELY_API_KEY) || !!env.IFRAMELY_URL;
// To be considered enabled either we're using the default (cloud) host and have an API key,
// or we're using a custom host where no API key is required.
const enabled =
(isDefaultHost && !!env.IFRAMELY_API_KEY) ||
(!isDefaultHost && !!env.IFRAMELY_URL);
if (enabled) {
PluginManager.add([