···1919 dismissActiveNux: () => void
2020}
21212222-/**
2323- * If we fail to complete a NUX here, it may show again on next reload,
2424- * or if prefs state updates. If `true`, this fallback ensures that the last
2525- * shown NUX won't show again, at least for this session.
2626- *
2727- * This is temporary, and only needed for the 10Milly dialog rn, since we
2828- * aren't snoozing that one in device storage.
2929- */
3030-let __isSnoozedFallback = false
3131-3222const queuedNuxs: {
3323 id: Nux
3434- enabled(props: {gate: ReturnType<typeof useGate>}): boolean
3535- /**
3636- * TEMP only intended for use with the 10Milly dialog rn, since there are no
3737- * other NUX dialogs configured
3838- */
3939- unsafe_disableSnooze: boolean
2424+ enabled?: (props: {gate: ReturnType<typeof useGate>}) => boolean
4025}[] = [
4126 {
4227 id: Nux.TenMillionDialog,
4343- enabled({gate}) {
4444- return gate('ten_million_dialog')
4545- },
4646- unsafe_disableSnooze: true,
4728 },
4829]
4930···9273 }
93749475 React.useEffect(() => {
9595- if (__isSnoozedFallback) return
9676 if (snoozed) return
9777 if (!nuxs) return
98789999- for (const {id, enabled, unsafe_disableSnooze} of queuedNuxs) {
7979+ for (const {id, enabled} of queuedNuxs) {
10080 const nux = nuxs.find(nux => nux.id === id)
1018110282 // check if completed first
10383 if (nux && nux.completed) continue
1048410585 // then check gate (track exposure)
106106- if (!enabled({gate})) continue
8686+ if (enabled && !enabled({gate})) continue
1078710888 // we have a winner
10989 setActiveNux(id)
11090111111- /**
112112- * TEMP only intended for use with the 10Milly dialog rn, since there are no
113113- * other NUX dialogs configured
114114- */
115115- if (!unsafe_disableSnooze) {
116116- // immediately snooze for a day
117117- snoozeNuxDialog()
118118- }
9191+ // immediately snooze for a day
9292+ snoozeNuxDialog()
1199312094 // immediately update remote data (affects next reload)
12195 upsertNux({
···126100 logger.error(`NUX dialogs: failed to upsert '${id}' NUX`, {
127101 safeMessage: e.message,
128102 })
129129- /*
130130- * TEMP only intended for use with the 10Milly dialog rn
131131- */
132132- if (unsafe_disableSnooze) {
133133- __isSnoozedFallback = true
134134- }
135103 })
136104137105 break
-4
src/lib/hooks/useIntentHandler.ts
···9797 if (part.includes('https://') || part.includes('http://')) {
9898 return false
9999 }
100100- console.log({
101101- part,
102102- text: VALID_IMAGE_REGEX.test(part),
103103- })
104100 // We also should just filter out cases that don't have all the info we need
105101 return VALID_IMAGE_REGEX.test(part)
106102 })