about summary refs log tree commit diff
path: root/src/components/dialogs/nuxs/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/dialogs/nuxs/index.tsx')
-rw-r--r--src/components/dialogs/nuxs/index.tsx42
1 files changed, 5 insertions, 37 deletions
diff --git a/src/components/dialogs/nuxs/index.tsx b/src/components/dialogs/nuxs/index.tsx
index a13d99eb2..a38c87b68 100644
--- a/src/components/dialogs/nuxs/index.tsx
+++ b/src/components/dialogs/nuxs/index.tsx
@@ -19,31 +19,12 @@ type Context = {
   dismissActiveNux: () => void
 }
 
-/**
- * If we fail to complete a NUX here, it may show again on next reload,
- * or if prefs state updates. If `true`, this fallback ensures that the last
- * shown NUX won't show again, at least for this session.
- *
- * This is temporary, and only needed for the 10Milly dialog rn, since we
- * aren't snoozing that one in device storage.
- */
-let __isSnoozedFallback = false
-
 const queuedNuxs: {
   id: Nux
-  enabled(props: {gate: ReturnType<typeof useGate>}): boolean
-  /**
-   * TEMP only intended for use with the 10Milly dialog rn, since there are no
-   * other NUX dialogs configured
-   */
-  unsafe_disableSnooze: boolean
+  enabled?: (props: {gate: ReturnType<typeof useGate>}) => boolean
 }[] = [
   {
     id: Nux.TenMillionDialog,
-    enabled({gate}) {
-      return gate('ten_million_dialog')
-    },
-    unsafe_disableSnooze: true,
   },
 ]
 
@@ -92,30 +73,23 @@ function Inner() {
   }
 
   React.useEffect(() => {
-    if (__isSnoozedFallback) return
     if (snoozed) return
     if (!nuxs) return
 
-    for (const {id, enabled, unsafe_disableSnooze} of queuedNuxs) {
+    for (const {id, enabled} of queuedNuxs) {
       const nux = nuxs.find(nux => nux.id === id)
 
       // check if completed first
       if (nux && nux.completed) continue
 
       // then check gate (track exposure)
-      if (!enabled({gate})) continue
+      if (enabled && !enabled({gate})) continue
 
       // we have a winner
       setActiveNux(id)
 
-      /**
-       * TEMP only intended for use with the 10Milly dialog rn, since there are no
-       * other NUX dialogs configured
-       */
-      if (!unsafe_disableSnooze) {
-        // immediately snooze for a day
-        snoozeNuxDialog()
-      }
+      // immediately snooze for a day
+      snoozeNuxDialog()
 
       // immediately update remote data (affects next reload)
       upsertNux({
@@ -126,12 +100,6 @@ function Inner() {
         logger.error(`NUX dialogs: failed to upsert '${id}' NUX`, {
           safeMessage: e.message,
         })
-        /*
-         * TEMP only intended for use with the 10Milly dialog rn
-         */
-        if (unsafe_disableSnooze) {
-          __isSnoozedFallback = true
-        }
       })
 
       break