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_ENTRY_EDITOR)) {
render(, document.getElementById('root'));
}
});
init(sdk => {
if (sdk.location.is(locations.LOCATION_ENTRY_EDITOR)) {
render(, document.getElementById('root'));
}
});
accessToken={this.state.accessToken}
sdk={this.props.sdk}
client={this.state.client}
/>
);
}
if (location.is(locations.LOCATION_ENTRY_SIDEBAR)) {
if (!parameters.installation.optimizelyProjectId) {
return ;
}
return ;
}
if (location.is(locations.LOCATION_ENTRY_EDITOR)) {
const [valid, missingFields] = isValidContentType(sdk.contentType);
if (!valid) {
return ;
}
return (
);
}
}