Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
init(sdk => {
window.sdk = sdk
if (sdk.location.is(locations.LOCATION_ENTRY_FIELD)) {
renderExtension()
} else if (sdk.location.is(locations.LOCATION_PAGE)) {
renderExtension()
} else if (sdk.location.is(locations.LOCATION_ENTRY_SIDEBAR)) {
renderExtension()
} else if (sdk.location.is(locations.LOCATION_ENTRY_EDITOR)) {
renderExtension()
} else if (sdk.location.is(locations.LOCATION_DIALOG)) {
renderExtension()
}
})
init(sdk => {
if (sdk.location.is(locations.LOCATION_DIALOG)) {
renderDialog(sdk);
} else if (sdk.location.is(locations.LOCATION_APP)) {
ReactDOM.render(, document.getElementById('root'));
} else {
ReactDOM.render(, document.getElementById('root'));
}
});
init(sdk => {
const root = document.getElementById('root');
if (sdk.location.is(locations.LOCATION_DIALOG)) {
integration.renderDialog(sdk as DialogExtensionSDK);
}
if (sdk.location.is(locations.LOCATION_ENTRY_FIELD)) {
render(
,
root
);
}
init(extension => {
extension.window.startAutoResizer();
const rootElm = document.getElementById('root');
if (extension.location.is(locations.LOCATION_ENTRY_SIDEBAR)) {
ReactDOM.render(, rootElm);
} else if (extension.location.is(locations.LOCATION_DIALOG)) {
const { dialog } = extension.parameters.invocation;
if (dialog === 'details') {
ReactDOM.render(, rootElm);
}
}
});
init(extension => {
const installationParameters = extension.parameters.installation;
extension.window.startAutoResizer();
if (extension.location.is(locations.LOCATION_ENTRY_FIELD)) {
ReactDOM.render(
,
document.getElementById('root')
);
} else if (extension.location.is(locations.LOCATION_DIALOG)) {
ReactDOM.render(
,
document.getElementById('root')
);
}
});
init(sdk => {
if (sdk.location.is(locations.LOCATION_DIALOG)) {
render(, document.getElementById('root'));
} else {
render(, document.getElementById('root'));
}
});
export const initialize = sdk => {
if (sdk.location.is(locations.LOCATION_DIALOG)) {
ReactDOM.render(, document.getElementById('root'));
} else {
ReactDOM.render(, document.getElementById('root'));
}
};