about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAnsh Nanda <anshnanda10@gmail.com>2023-08-28 18:47:56 -0700
committerAnsh Nanda <anshnanda10@gmail.com>2023-08-28 18:47:56 -0700
commitbcef7400db65b1a1ce01c655bc0e16530254de5a (patch)
tree0d36e71715a487c8ee0577864ca6547b7489bf42 /src
parenta231fdf64e2b2801b055e355dddcef06dfb3f47e (diff)
downloadvoidsky-bcef7400db65b1a1ce01c655bc0e16530254de5a.tar.zst
simplify onboarding model function naming
Diffstat (limited to 'src')
-rw-r--r--src/state/models/discovery/onboarding.ts9
-rw-r--r--src/view/com/auth/onboarding/RecommendedFeeds.tsx2
-rw-r--r--src/view/com/auth/onboarding/Welcome.tsx2
-rw-r--r--src/view/screens/Home.tsx4
4 files changed, 11 insertions, 6 deletions
diff --git a/src/state/models/discovery/onboarding.ts b/src/state/models/discovery/onboarding.ts
index 02a7b7a0b..cb0c21371 100644
--- a/src/state/models/discovery/onboarding.ts
+++ b/src/state/models/discovery/onboarding.ts
@@ -47,7 +47,12 @@ export class OnboardingModel {
     }
   }
 
-  nextScreenName(currentScreenName?: OnboardingStep) {
+  /**
+   * Returns the name of the next screen in the onboarding process based on the current step or screen name provided.
+   * @param {OnboardingStep} [currentScreenName]
+   * @returns name of next screen in the onboarding process
+   */
+  next(currentScreenName?: OnboardingStep) {
     if (currentScreenName === 'Welcome' || this.step === 'Welcome') {
       track('Onboarding:Begin')
       this.step = 'RecommendedFeeds'
@@ -78,7 +83,7 @@ export class OnboardingModel {
     return this.step === 'Home'
   }
 
-  get isRemaining() {
+  get isActive() {
     return !this.isComplete
   }
 }
diff --git a/src/view/com/auth/onboarding/RecommendedFeeds.tsx b/src/view/com/auth/onboarding/RecommendedFeeds.tsx
index 88fb200c6..2f4c63daf 100644
--- a/src/view/com/auth/onboarding/RecommendedFeeds.tsx
+++ b/src/view/com/auth/onboarding/RecommendedFeeds.tsx
@@ -125,7 +125,7 @@ export const RecommendedFeeds = observer(({navigation}: Props) => {
   const store = useStores()
 
   const next = () => {
-    const nextScreenName = store.onboarding.nextScreenName('RecommendedFeeds')
+    const nextScreenName = store.onboarding.next('RecommendedFeeds')
     if (nextScreenName) {
       navigation.navigate(nextScreenName)
     }
diff --git a/src/view/com/auth/onboarding/Welcome.tsx b/src/view/com/auth/onboarding/Welcome.tsx
index cb3a2307a..a1e97a32f 100644
--- a/src/view/com/auth/onboarding/Welcome.tsx
+++ b/src/view/com/auth/onboarding/Welcome.tsx
@@ -25,7 +25,7 @@ export const Welcome = observer(({navigation}: Props) => {
   }, [store.shell.minimalShellMode, store])
 
   const next = () => {
-    const nextScreenName = store.onboarding.nextScreenName('Welcome')
+    const nextScreenName = store.onboarding.next('Welcome')
     if (nextScreenName) {
       navigation.navigate(nextScreenName)
     }
diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx
index f2aa208c3..7017c698c 100644
--- a/src/view/screens/Home.tsx
+++ b/src/view/screens/Home.tsx
@@ -41,10 +41,10 @@ export const HomeScreen = withAuthRequired(
     >([])
 
     React.useEffect(() => {
-      if (store.onboarding.isRemaining) {
+      if (store.onboarding.isActive) {
         navigation.navigate('Welcome')
       }
-    }, [store.onboarding.isRemaining, navigation])
+    }, [store.onboarding.isActive, navigation])
 
     React.useEffect(() => {
       const {pinned} = store.me.savedFeeds