Skip to content

Commit

Permalink
Set back after demo
Browse files Browse the repository at this point in the history
  • Loading branch information
lbare committed Apr 5, 2024
1 parent 644f841 commit 58a1db9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 43 deletions.
43 changes: 20 additions & 23 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { getDoc, getDocs, doc, collection } from "firebase/firestore";
import { BuildingContext } from "./contexts/BuildingContext";
import { db } from "./services/firebase";
import loadAssets from "./hooks/loadAssets";
import { TouchableWithoutFeedback, View } from "react-native";
import { Image } from "react-native";
import AsyncStorage from "@react-native-async-storage/async-storage";
import BackgroundImage from "./components/BackgroundImage";

export default function App() {
const [buildings, setBuildings] = useState<Building[]>([]);
Expand Down Expand Up @@ -79,27 +78,25 @@ export default function App() {
prepare();
}, []);

if (!isFinalReady) {
if (!isReady)
return (
<View className="flex w-full h-full">
<BackgroundImage source={require("./assets/splash.png")} />
<TouchableWithoutFeedback
className="w-full h-full"
onPress={() => {
if (isReady) setIsFinalReady(true);
}}
>
<View className="flex w-full h-full justify-center items-center" />
</TouchableWithoutFeedback>
</View>
);
} else
return (
<BuildingContext.Provider value={buildings}>
<NavigationContainer>
<HomeNavigation />
<StatusBar style="light" />
</NavigationContainer>
</BuildingContext.Provider>
<Image
source={require("./assets/splash.png")}
style={{
flex: 1,
width: "100%",
height: "100%",
resizeMode: "cover",
}}
/>
);

return (
<BuildingContext.Provider value={buildings}>
<NavigationContainer>
<HomeNavigation />
<StatusBar style="light" />
</NavigationContainer>
</BuildingContext.Provider>
);
}
38 changes: 18 additions & 20 deletions screens/HomeMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,27 +136,25 @@ const HomeMap: React.FC = () => {
menuSearch = new MenuSearch(buildings); // useEffect only creates once on first render
onZoomChange(UVicRegion);

setWelcomePopupPage(WelcomePopupCategories.WelcomeTour);

// Show welcome tour on app first launch
// AsyncStorage.getItem("is_first_launch").then((value) => {
// if (value !== "true") {
// AsyncStorage.setItem("is_first_launch", "true");
// setWelcomePopupPage(WelcomePopupCategories.WelcomeTour);
// console.log("Show welcome popup on first launch");
// } else {
// // Show version notes on first launch of new version
// // but only if it's not the very first launch after first install
// AsyncStorage.getItem("last_version_notes_shown").then((value) => {
// const latestVersion = versionNotes[0].version;
// if (value !== latestVersion) {
// AsyncStorage.setItem("last_version_notes_shown", latestVersion);
// setWelcomePopupPage(WelcomePopupCategories.VersionNotes);
// console.log("Show version notes on first launch of new version");
// }
// });
// }
// });
AsyncStorage.getItem("is_first_launch").then((value) => {
if (value !== "true") {
AsyncStorage.setItem("is_first_launch", "true");
setWelcomePopupPage(WelcomePopupCategories.WelcomeTour);
console.log("Show welcome popup on first launch");
} else {
// Show version notes on first launch of new version
// but only if it's not the very first launch after first install
AsyncStorage.getItem("last_version_notes_shown").then((value) => {
const latestVersion = versionNotes[0].version;
if (value !== latestVersion) {
AsyncStorage.setItem("last_version_notes_shown", latestVersion);
setWelcomePopupPage(WelcomePopupCategories.VersionNotes);
console.log("Show version notes on first launch of new version");
}
});
}
});
}, []);

useEffect(() => {
Expand Down

0 comments on commit 58a1db9

Please sign in to comment.