Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function(action$, { api }) {
return action$.pipe(
ofType(RUN_UPGRADE_PACKAGE_TESTS),
mergeMap(async () => {
await api.upgrade.cluster_pre_upgrade({});
})
);
}
function _replaceModalAfterSuccess(action$) {
return action$.pipe(
ofType(COMPLETE_CREATE_ACCOUNT),
mergeMap(action => {
const { accountName, password } = action.payload;
return action$.pipe(
ofType(COMPLETE_FETCH_SYSTEM_INFO),
take(1),
map(() => replaceWithAccountCreatedModal(accountName, password))
);
})
);
}
export default function(action$, { browser }) {
return action$.pipe(
ofType(COMPLETE_UPGRADE_SYSTEM),
map(action => {
const { system, version } = action.payload;
const url = realizeUri(routes.system, { system }, { afterupgrade: version });
browser.reload(url);
})
);
}
export default function(action$, { api }) {
return action$.pipe(
ofType(LEAVE_MAINTENANCE_MODE),
mergeMap(async () => {
try {
await api.system.set_maintenance_mode({ duration : 0 });
return completeLeaveMaintenanceMode();
} catch (error) {
return failLeaveMaintenanceMode(
mapErrorObject(error)
);
}
})
);
}
export default function(action$) {
return action$.pipe(
ofType(FAIL_CREATE_ACCOUNT),
map(() => closeModal())
);
}