Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const engageWillLeave =
prevProps.app.isVisible === true && this.props.app.isVisible === false;
if (routeDidEnter || engageDidEnter) {
// Sync the colors of the app bar when the route with the bar came visible.
this.updateStatusBar();
}
if (engageWillLeave) {
// Reset the status bar when Engage goes into the background.
this.props.resetStatusBar();
}
if (prevProps.title !== this.props.title) {
const { __ } = this.context.i18n();
router.update(this.props.route.id, { title: __(this.props.title) });
}
}
const engageWillLeave =
prevProps.app.isVisible === true && this.props.app.isVisible === false;
if (routeDidEnter || engageDidEnter) {
// Sync the colors of the app bar when the route with the bar came visible.
this.updateStatusBar();
}
if (engageWillLeave) {
// Reset the status bar when Engage goes into the background.
this.props.resetStatusBar();
}
if (prevProps.title !== this.props.title) {
const { __ } = this.context.i18n();
router.update(this.props.route.id, { title: __(this.props.title) });
}
}
}
if (this.props.setFocus && target) {
// Set the focus to the first focusable element for screen readers.
const focusable = target.querySelector('button:not([aria-hidden="true"]), [tabindex]:not([tabindex="-1"])');
if (focusable) {
focusable.focus();
}
}
if (this.props.route.visible) {
this.updateStatusBar();
if (this.props.title) {
const { __ } = this.context.i18n();
router.update(this.props.route.id, { title: __(this.props.title) });
}
}
}
save = () => {
const { currentFilters, filters } = this.state;
router.update(
this.props.parentId,
{ filters: buildUpdatedFilters(currentFilters, filters) }
);
setTimeout(router.pop, 250);
}
save = () => {
const { currentFilters, filters } = this.state;
router.update(
this.props.parentId,
{ filters: buildUpdatedFilters(currentFilters, filters) }
);
setTimeout(router.pop, 250);
}
if (!target) {
target = document.getElementById('AppHeader');
this.setState({ target: target || null });
}
if (this.props.setFocus) {
this.setFocus();
}
if (this.props.route.visible) {
this.updateStatusBar();
if (this.props.title) {
const { __ } = this.context.i18n();
router.update(this.props.route.id, { title: __(this.props.title) });
}
}
}