Skip to content

Commit

Permalink
fix default url broken error
Browse files Browse the repository at this point in the history
  • Loading branch information
MAX-786 committed Jun 23, 2024
1 parent 8887c85 commit f847efa
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/volto-hydra/src/components/Iframe/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ import { setSelectedBlock } from '../../actions';
import usePresetUrls from '../../utils/usePresetsUrls';
import UrlInput from '../UrlInput';

/**
* Get the default URL from the environment
* @returns {string} URL from the environment
*/
const getDefualtUrl = () =>
process.env['RAZZLE_DEFAULT_IFRAME_URL'] ||
(typeof window !== 'undefined' && window.env['RAZZLE_DEFAULT_IFRAME_URL']) ||
'http://localhost:3002'; // fallback if env is not set

/**
* Format the URL for the Iframe with location, token and enabling edit mode
* @param {*} url
Expand All @@ -39,7 +30,7 @@ const Iframe = () => {
const form = useSelector((state) => state.form.global);
const presetUrls = usePresetUrls();

const defaultUrl = getDefualtUrl();
const defaultUrl = presetUrls[0] || 'http://localhost:3002';
const savedUrl = Cookies.get('iframe_url');
const initialUrl = savedUrl
? getUrlWithAdminParams(savedUrl, token)
Expand Down

0 comments on commit f847efa

Please sign in to comment.