1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-24 01:18:01 +02:00

fix: use specific attribute as useEffect trigger (#527)

* fix: use specific attribute as useEffect trigger

* fix: handle splash being undefined
This commit is contained in:
Fredrik Strand Oseberg 2021-11-26 13:15:39 +01:00 committed by GitHub
parent c34d8439bd
commit d706bfc7bc
2 changed files with 5 additions and 12 deletions

View File

@ -67,16 +67,6 @@ describe('feature toggle', () => {
cy.get('[data-test="LOGIN_PASSWORD_ID"]').type('qY70$NDcJNXA');
cy.get("[data-test='LOGIN_BUTTON']").click();
cy.request({
method: 'POST',
url: `${
Cypress.config().baseUrl
}/api/admin/features/${featureToggleName}`,
headers: {
Authorization: authToken,
},
});
} else {
cy.get('[data-test=LOGIN_EMAIL_ID]').type('test@unleash-e2e.com');
cy.get('[data-test=LOGIN_BUTTON]').click();

View File

@ -36,9 +36,12 @@ const App = ({ location, user, fetchUiBootstrap }: IAppProps) => {
}, [user.authDetails?.type]);
useEffect(() => {
setShowSplash(!splash?.environments && !isUnauthorized());
if (splash?.environments === undefined) return;
if (!splash?.environments && !isUnauthorized()) {
setShowSplash(true);
}
/* eslint-disable-next-line */
}, [splash]);
}, [splash.environments]);
const renderMainLayoutRoutes = () => {
return routes.filter(route => route.layout === 'main').map(renderRoute);