Skip to content

Commit 2d4db55

Browse files
committed
Enhance onboarding flow and fix iOS back button issue
1 parent 2d80e51 commit 2d4db55

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

components/home.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,11 @@ setShowCountryButtons(false)
16021602
window.crazyMidgame = crazyMidgame;
16031603

16041604
}, []);
1605+
1606+
16051607
function backBtnPressed(queueNextGame = false, nextGameType) {
1608+
setStreetViewShown(false)
1609+
setOnboardingCompleted(true)
16061610

16071611
if (loading) setLoading(false);
16081612
if(multiplayerError) setMultiplayerError(false)
@@ -1618,13 +1622,11 @@ setShowCountryButtons(false)
16181622
if(screen === "onboarding") {
16191623
setScreen("home")
16201624
setOnboarding(null)
1621-
setOnboardingCompleted(true)
16221625
gameStorage.setItem("onboarding", 'done')
16231626

16241627
return;
16251628
}
16261629

1627-
setStreetViewShown(false)
16281630

16291631
if (multiplayerState?.inGame) {
16301632
if(!multiplayerState?.gameData?.host || multiplayerState?.gameData?.state === "waiting") {
@@ -2050,8 +2052,8 @@ setShowCountryButtons(false)
20502052
</button>
20512053
)}
20522054

2055+
<div className={`home__content ${screen !== "home" ? "hidden" : "cshown"} `}>
20532056

2054-
<div className={`home__content ${screen !== "home" ? "hidden" : ""} `}>
20552057

20562058

20572059
{ onboardingCompleted===null ? (

styles/globals.scss

+10
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ html {
5252
animation: hide 0.5s ease-in-out forwards;
5353
pointer-events: none;
5454
}
55+
// we have to do this for ios otherwise back btn makes a blank home page, not sure why
56+
// not even all ios devices some randomly
57+
.cshown {
58+
left: 50%;
59+
opacity: 1;
60+
animation: fadeIn 0.5s ease-in-out forwards;
61+
pointer-events: all;
62+
display: flex !important;
63+
64+
}
5565

5666
.home__btns {
5767
display: flex;

0 commit comments

Comments
 (0)