Compare commits

...

2 Commits

Author SHA1 Message Date
Clément Pasteau
c6b7b90694 Remove templates page 2024-12-16 11:32:25 +01:00
Clément Pasteau
a1ae2c08fb Fix loader on games list 2024-12-16 11:20:22 +01:00
2 changed files with 5 additions and 23 deletions

View File

@@ -23,6 +23,7 @@ const useGamesList = (): GamesList => {
authenticated,
firebaseUser,
getAuthorizationHeader,
loginState,
} = authenticatedUser;
const [games, setGames] = React.useState<?Array<Game>>(null);
@@ -32,6 +33,8 @@ const useGamesList = (): GamesList => {
const fetchGames = React.useCallback(
async (): Promise<void> => {
if (loginState !== 'done') return;
if (!authenticated || !firebaseUser) {
setGames([]);
return;
@@ -53,7 +56,7 @@ const useGamesList = (): GamesList => {
gamesFetchingPromise.current = null;
}
},
[authenticated, firebaseUser, getAuthorizationHeader]
[authenticated, firebaseUser, getAuthorizationHeader, loginState]
);
const onGameUpdated = React.useCallback(

View File

@@ -146,7 +146,6 @@ const CreateSection = ({
const [initialWidgetToScrollTo, setInitialWidgetToScrollTo] = React.useState(
null
);
const [showAllGameTemplates, setShowAllGameTemplates] = React.useState(false);
const { routeArguments, removeRouteArguments } = React.useContext(
RouterContext
);
@@ -445,26 +444,6 @@ const CreateSection = ({
);
}
if (showAllGameTemplates) {
return (
<SectionContainer
backAction={() => setShowAllGameTemplates(false)}
flexBody
>
<SectionRow expand>
<ExampleStore
onSelectExampleShortHeader={onSelectExampleShortHeader}
onSelectPrivateGameTemplateListingData={
onSelectPrivateGameTemplateListingData
}
i18n={i18n}
columnsCount={getExampleItemsColumns(windowSize, isLandscape)}
/>
</SectionRow>
</SectionContainer>
);
}
return (
<I18n>
{({ i18n }) => (
@@ -610,7 +589,7 @@ const CreateSection = ({
<Trans>Start from a template</Trans>
</Text>
<FlatButton
onClick={() => setShowAllGameTemplates(true)}
onClick={onOpenNewProjectSetupDialog}
label={
isMobile ? (
<Trans>Browse</Trans>