fix: cloudlink url
This commit is contained in:
@@ -238,7 +238,7 @@ export const ComponentView: FunctionalComponent<IProps> = observer(
|
||||
ref={iframeRef}
|
||||
data-component-viewer-id={componentViewer.identifier}
|
||||
frameBorder={0}
|
||||
src={application.componentManager.urlForComponent(component) || ''}
|
||||
src={componentViewer.url || ''}
|
||||
sandbox="allow-scripts allow-top-navigation-by-user-activation allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-modals allow-forms allow-downloads"
|
||||
>
|
||||
Loading
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { PreferencesGroup, PreferencesSegment } from '@/preferences/components';
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { ComponentViewer, SNComponent } from '@standardnotes/snjs/dist/@types';
|
||||
import { ComponentViewer, SNComponent } from '@standardnotes/snjs';
|
||||
import { FeatureIdentifier } from '@standardnotes/features';
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import { FunctionComponent } from 'preact';
|
||||
import { ExtensionItem } from './extensions-segments';
|
||||
@@ -16,10 +17,23 @@ interface IProps {
|
||||
preferencesMenu: PreferencesMenu;
|
||||
}
|
||||
|
||||
const urlOverrideForExtension = (extension: SNComponent) => {
|
||||
if (extension.identifier === FeatureIdentifier.CloudLink) {
|
||||
return 'https://extensions.standardnotes.org/components/cloudlink';
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
export const ExtensionPane: FunctionComponent<IProps> = observer(
|
||||
({ extension, application, appState, preferencesMenu }) => {
|
||||
const [componentViewer] = useState<ComponentViewer>(
|
||||
application.componentManager.createComponentViewer(extension)
|
||||
application.componentManager.createComponentViewer(
|
||||
extension,
|
||||
undefined,
|
||||
undefined,
|
||||
urlOverrideForExtension(extension)
|
||||
)
|
||||
);
|
||||
const latestVersion =
|
||||
preferencesMenu.extensionsLatestVersions.getVersion(extension);
|
||||
|
||||
Reference in New Issue
Block a user