mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-27 11:02:16 +01: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:
parent
c34d8439bd
commit
d706bfc7bc
@ -67,16 +67,6 @@ describe('feature toggle', () => {
|
|||||||
cy.get('[data-test="LOGIN_PASSWORD_ID"]').type('qY70$NDcJNXA');
|
cy.get('[data-test="LOGIN_PASSWORD_ID"]').type('qY70$NDcJNXA');
|
||||||
|
|
||||||
cy.get("[data-test='LOGIN_BUTTON']").click();
|
cy.get("[data-test='LOGIN_BUTTON']").click();
|
||||||
|
|
||||||
cy.request({
|
|
||||||
method: 'POST',
|
|
||||||
url: `${
|
|
||||||
Cypress.config().baseUrl
|
|
||||||
}/api/admin/features/${featureToggleName}`,
|
|
||||||
headers: {
|
|
||||||
Authorization: authToken,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
cy.get('[data-test=LOGIN_EMAIL_ID]').type('test@unleash-e2e.com');
|
cy.get('[data-test=LOGIN_EMAIL_ID]').type('test@unleash-e2e.com');
|
||||||
cy.get('[data-test=LOGIN_BUTTON]').click();
|
cy.get('[data-test=LOGIN_BUTTON]').click();
|
||||||
|
|||||||
@ -36,9 +36,12 @@ const App = ({ location, user, fetchUiBootstrap }: IAppProps) => {
|
|||||||
}, [user.authDetails?.type]);
|
}, [user.authDetails?.type]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setShowSplash(!splash?.environments && !isUnauthorized());
|
if (splash?.environments === undefined) return;
|
||||||
|
if (!splash?.environments && !isUnauthorized()) {
|
||||||
|
setShowSplash(true);
|
||||||
|
}
|
||||||
/* eslint-disable-next-line */
|
/* eslint-disable-next-line */
|
||||||
}, [splash]);
|
}, [splash.environments]);
|
||||||
|
|
||||||
const renderMainLayoutRoutes = () => {
|
const renderMainLayoutRoutes = () => {
|
||||||
return routes.filter(route => route.layout === 'main').map(renderRoute);
|
return routes.filter(route => route.layout === 'main').map(renderRoute);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user