PluginProbe
Extendify / 3.2.3
Extendify v3.2.3
3.2.3 3.2.2 3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 All 129 releases
← All changes | src/Agent/lib/redirects.js +5 -10 3.1.4 → 3.2.3 View file →
@@ -1,17 +1,12 @@
1 1 const { pluginRecommendations = [] } = window?.extAgentData?.agentContext || {};
2 2 const { adminUrl, homeUrl } = window?.extSharedData || {};
3 3
4 -export const getRedirectUrl = (redirectTo, options = {}) => {
5 - if (redirectTo?.type === 'plugin-setup') {
6 - const plugin = pluginRecommendations.find(
7 - ({ slug }) => slug === options.pluginSlug,
8 - );
9 - if (!plugin) return '';
10 - return makeRedirectUrl(plugin.redirectTo);
11 - }
12 -
13 - return '';
4 +export const getPluginSetup = (pluginSlug) => {
5 + const plugin = pluginRecommendations.find(({ slug }) => slug === pluginSlug);
6 + if (!plugin?.redirectTo) return null;
7 + const url = makeRedirectUrl(plugin.redirectTo);
8 + return url ? { title: plugin.title, url } : null;
14 9 };
15 10
16 11 const makeRedirectUrl = (url) => {
17 12 try {