From 5a29274c3c39eb385e1ddb5583169c9fd334d67c Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 9 Sep 2022 17:06:43 -0700 Subject: [PATCH 1/4] [C-996] Remove NATIVE_MOBILE references --- .../selectors/optimistic-challenges.ts | 16 ++- packages/mobile/.env.dev.tmpl | 1 - packages/mobile/.env.prod.tmpl | 1 - packages/mobile/.env.stage.tmpl | 1 - .../ChallengeRewardsDrawerProvider.tsx | 4 +- .../screens/audio-screen/ChallengeRewards.tsx | 4 +- packages/web/.env/.env.mobile.prod | 5 +- packages/web/.env/.env.mobile.stage | 5 +- .../web/src/common/store/backend/sagas.ts | 4 +- .../src/common/store/cache/tracks/sagas.js | 5 +- packages/web/src/common/store/lineup/sagas.js | 4 - packages/web/src/common/store/oauth/sagas.ts | 6 +- .../src/common/store/pages/signon/reducer.js | 7 +- .../src/common/store/reachability/sagas.ts | 10 +- .../src/common/store/social/tracks/sagas.ts | 5 +- .../animated-switch/AnimatedSwitch.tsx | 36 +----- .../AppRedirectListener.tsx | 17 ++- .../components/AppRedirectPopover.tsx | 4 +- .../components/CollectibleDetailsModal.tsx | 4 +- .../components/CollectiblesPage.tsx | 31 +++--- .../src/components/drawer/Drawer.module.css | 4 +- packages/web/src/components/drawer/Drawer.tsx | 7 +- .../edit-playlist/mobile/EditPlaylistPage.tsx | 7 +- .../instagram-auth/InstagramAuth.tsx | 22 +--- .../MobilePageContainer.tsx | 9 +- .../MobileUploadDrawer.tsx | 4 +- .../nav/mobile/ConnectedBottomBar.tsx | 15 +-- .../now-playing/NowPlaying.module.css | 6 +- .../src/components/now-playing/NowPlaying.tsx | 8 +- .../now-playing/NowPlayingDrawer.module.css | 4 - .../now-playing/NowPlayingDrawer.tsx | 7 +- .../search-bar/SearchBar.module.css | 2 +- .../src/components/search-bar/SearchBar.tsx | 26 ++--- .../ShareSoundToTikTokModal.tsx | 32 +++--- .../components/twitter-auth/TwitterAuth.js | 35 +----- packages/web/src/pages/App.js | 7 +- .../src/pages/audio-rewards-page/Tiles.tsx | 4 +- .../components/WalletManagementTile.tsx | 3 +- .../components/modals/RewardsModals.tsx | 16 +-- .../components/modals/TopAPI.tsx | 4 +- .../components/modals/TrendingRewards.tsx | 4 +- .../mobile/DeactivateAccountPage.tsx | 24 ++-- .../components/mobile/FeedPageContent.tsx | 14 +-- packages/web/src/pages/modals/Modals.tsx | 18 +-- .../pages/saved-page/SavedPageProvider.tsx | 6 +- .../mobile/SearchPageContent.module.css | 4 - .../components/mobile/SearchPageContent.tsx | 25 +---- .../settings-page/SettingsPageProvider.tsx | 17 +-- .../NotificationsSettingsPage.module.css | 19 ---- .../mobile/NotificationsSettingsPage.tsx | 105 +----------------- .../components/mobile/SettingsPage.tsx | 35 ------ packages/web/src/pages/sign-on/SignOn.tsx | 6 +- .../components/mobile/InitialPage.module.css | 10 -- .../sign-on/components/mobile/InitialPage.tsx | 8 +- packages/web/src/root.tsx | 9 +- .../web/src/services/analytics/segment.ts | 11 +- .../audio-player/NativeMobileAudio.ts | 15 --- .../web/src/services/audio-player/index.ts | 7 +- .../audius-backend/audius-backend-instance.ts | 9 +- .../web/src/utils/browserNotifications.ts | 11 +- packages/web/src/utils/clientUtil.ts | 4 - packages/web/src/utils/clipboardUtil.ts | 5 +- packages/web/src/utils/gdpr.ts | 1 - packages/web/src/utils/logger.js | 6 +- packages/web/src/utils/sagaPollingDaemons.ts | 18 --- 65 files changed, 147 insertions(+), 636 deletions(-) delete mode 100644 packages/web/src/services/audio-player/NativeMobileAudio.ts diff --git a/packages/common/src/store/challenges/selectors/optimistic-challenges.ts b/packages/common/src/store/challenges/selectors/optimistic-challenges.ts index 224e4d87ae..d818646e5f 100644 --- a/packages/common/src/store/challenges/selectors/optimistic-challenges.ts +++ b/packages/common/src/store/challenges/selectors/optimistic-challenges.ts @@ -15,7 +15,6 @@ import { import { CommonState } from '../../commonStore' import { getCompletionStages } from './profile-progress' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE /** * Gets the state of a user challenge, with the most progress dominating @@ -59,7 +58,7 @@ export const getOptimisticUserChallengeStepCounts = (state: CommonState) => { } /** * Converts a user challenge to an optimistic user challenge - * @param challenge The original UserChallenge + * @param challenge * @param stepCountOverrides the overrides to apply to challenge step counts * @param userChallengesOverrides the overrides to apply to other challenge states (currently used for disbursement) * @returns the optimistic state of that challenge @@ -70,7 +69,8 @@ const toOptimisticChallenge = ( stepCountOverrides: Partial>, userChallengesOverrides: Partial< Record> - > + >, + isNativeMobile?: boolean ): OptimisticUserChallenge => { const currentStepCountOverride = stepCountOverrides[challenge.challenge_id] const userChallengeOverrides = userChallengesOverrides[challenge.challenge_id] @@ -91,7 +91,7 @@ const toOptimisticChallenge = ( // If we're on native mobile, we might not yet have the is_mobile user_event // on DN, so optimistically mark this challenge as complete so the client // can start claiming - if (challenge.challenge_id === 'mobile-install' && NATIVE_MOBILE) { + if (challenge.challenge_id === 'mobile-install' && isNativeMobile) { challengeOverridden.is_complete = true } @@ -127,7 +127,10 @@ const toOptimisticChallenge = ( * @param challenge The user challenge to get the optimistic state for * @returns the same challenge with state and current_step_count overridden as necessary */ -export const getOptimisticUserChallenges = (state: CommonState) => { +export const getOptimisticUserChallenges = ( + state: CommonState, + isNativeMobile?: boolean +) => { const stepCountOverrides = getOptimisticUserChallengeStepCounts(state) const userChallengesOverrides = getUserChallengesOverrides(state) const userChallenges = getUserChallenges(state) @@ -144,7 +147,8 @@ export const getOptimisticUserChallenges = (state: CommonState) => { challenge, undisbursedUserChallenges[challenge.challenge_id] || [], stepCountOverrides, - userChallengesOverrides + userChallengesOverrides, + isNativeMobile ) ) .reduce((map, challenge) => { diff --git a/packages/mobile/.env.dev.tmpl b/packages/mobile/.env.dev.tmpl index d42f6e693b..0f6f735248 100644 --- a/packages/mobile/.env.dev.tmpl +++ b/packages/mobile/.env.dev.tmpl @@ -10,7 +10,6 @@ HCAPTCHA_BASE_URL=https://staging.audius.co AMPLITUDE_WRITE_KEY=abc OPTIMIZELY_KEY=MX4fYBgANQetvmBXGpuxzF SENTRY_DSN=https://4b15a7a2f2e2459997408b39a0c4942c@o260428.ingest.sentry.io/1851611 -NATIVE_NAVIGATION_ENABLED=true GENERAL_ADMISSION=https://general-admission.staging.audius.co diff --git a/packages/mobile/.env.prod.tmpl b/packages/mobile/.env.prod.tmpl index 959bbdad70..137cf92648 100644 --- a/packages/mobile/.env.prod.tmpl +++ b/packages/mobile/.env.prod.tmpl @@ -10,7 +10,6 @@ HCAPTCHA_BASE_URL=https://audius.co AMPLITUDE_WRITE_KEY=abc OPTIMIZELY_KEY=DAJbGEJBC21dzFRPv8snxs SENTRY_DSN=https://e26d2b01488f4b538ea235de6466c40a@o260428.ingest.sentry.io/1457231 -NATIVE_NAVIGATION_ENABLED=true GENERAL_ADMISSION=https://general-admission.audius.co diff --git a/packages/mobile/.env.stage.tmpl b/packages/mobile/.env.stage.tmpl index ebea2eb22c..128b1d6055 100644 --- a/packages/mobile/.env.stage.tmpl +++ b/packages/mobile/.env.stage.tmpl @@ -9,7 +9,6 @@ HCAPTCHA_BASE_URL=https://staging.audius.co AMPLITUDE_WRITE_KEY=abc OPTIMIZELY_KEY=MX4fYBgANQetvmBXGpuxzF SENTRY_DSN=https://4b15a7a2f2e2459997408b39a0c4942c@o260428.ingest.sentry.io/1851611 -NATIVE_NAVIGATION_ENABLED=true GENERAL_ADMISSION=https://general-admission.staging.audius.co diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx index 17cfdc08ba..ff94acb62e 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx @@ -48,7 +48,9 @@ export const ChallengeRewardsDrawerProvider = () => { const dispatch = useDispatch() const { onClose } = useDrawerState(MODAL_NAME) const modalType = useSelector(getChallengeRewardsModalType) - const userChallenges = useSelector(getOptimisticUserChallenges) + const userChallenges = useSelector((state) => + getOptimisticUserChallenges(state, true) + ) const handleClose = useCallback(() => { dispatch(resetAndCancelClaimReward()) diff --git a/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx b/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx index 7c8067ebbe..d1c9f934c3 100644 --- a/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx +++ b/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx @@ -70,7 +70,9 @@ export const ChallengeRewards = () => { const userChallengesLoading = useSelector(getUserChallengesLoading) const userChallenges = useSelector(getUserChallenges) - const optimisticUserChallenges = useSelector(getOptimisticUserChallenges) + const optimisticUserChallenges = useSelector((state) => + getOptimisticUserChallenges(state, true) + ) const [haveChallengesLoaded, setHaveChallengesLoaded] = useState(false) // The referred challenge only needs a tile if the user was referred diff --git a/packages/web/.env/.env.mobile.prod b/packages/web/.env/.env.mobile.prod index 451635efa5..205c3a54fe 100644 --- a/packages/web/.env/.env.mobile.prod +++ b/packages/web/.env/.env.mobile.prod @@ -1,4 +1 @@ -REACT_APP_NATIVE_MOBILE=true -REACT_APP_NATIVE_NAVIGATION_ENABLED=true - -PORT=3012 \ No newline at end of file +PORT=3012 diff --git a/packages/web/.env/.env.mobile.stage b/packages/web/.env/.env.mobile.stage index 637fe3c696..5808dc6a62 100644 --- a/packages/web/.env/.env.mobile.stage +++ b/packages/web/.env/.env.mobile.stage @@ -1,4 +1 @@ -REACT_APP_NATIVE_MOBILE=true -REACT_APP_NATIVE_NAVIGATION_ENABLED=true - -PORT=3011 \ No newline at end of file +PORT=3011 diff --git a/packages/web/src/common/store/backend/sagas.ts b/packages/web/src/common/store/backend/sagas.ts index 7ab73f1c9b..f27408afc3 100644 --- a/packages/web/src/common/store/backend/sagas.ts +++ b/packages/web/src/common/store/backend/sagas.ts @@ -20,7 +20,6 @@ import { RequestNetworkConnected } from 'services/native-mobile-interface/lifecy import * as backendActions from './actions' import { watchBackendErrors } from './errorSagas' const { getIsReachable } = reachabilitySelectors -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE const REACHABILITY_TIMEOUT_MS = 8 * 1000 @@ -48,7 +47,8 @@ export function* waitForBackendSetup() { } function* awaitReachability() { - if (!NATIVE_MOBILE) return true + const isNativeMobile = yield* getContext('isNativeMobile') + if (!isNativeMobile) return true // Request network connection information. // If we don't ask the native layer for it, it's possible that we never receive // and update. diff --git a/packages/web/src/common/store/cache/tracks/sagas.js b/packages/web/src/common/store/cache/tracks/sagas.js index 7328d035ef..4bb6c21d18 100644 --- a/packages/web/src/common/store/cache/tracks/sagas.js +++ b/packages/web/src/common/store/cache/tracks/sagas.js @@ -39,8 +39,6 @@ const { getTrack } = cacheTracksSelectors const setDominantColors = averageColorActions.setDominantColors const { getAccountUser, getUserId, getUserHandle } = accountSelectors -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - function* fetchRepostInfo(entries) { const userIds = [] entries.forEach((entry) => { @@ -122,7 +120,8 @@ function* watchAdd() { })) ) ) - if (!NATIVE_MOBILE) { + const isNativeMobile = yield getContext('isNativeMobile') + if (!isNativeMobile) { yield fork(fetchRepostInfo, action.entries) yield fork(fetchFirstSegments, action.entries) } diff --git a/packages/web/src/common/store/lineup/sagas.js b/packages/web/src/common/store/lineup/sagas.js index 11d0ba4c79..e8aab14411 100644 --- a/packages/web/src/common/store/lineup/sagas.js +++ b/packages/web/src/common/store/lineup/sagas.js @@ -34,14 +34,10 @@ const { getUsers } = cacheUsersSelectors const { getTrack, getTracks } = cacheTracksSelectors const { getCollection } = cacheCollectionsSelectors -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - // This is copied from web/src/utils since moving it to common would require // changing 90+ files. This will be ignored in RN-reloaded, since we check // isNativeMobile from storeContext first. export const isMobile = () => { - // If we are running with the mobile env flag set, short-circuit to `true` - if (IS_NATIVE_MOBILE) return true let check = false ;(function (a) { if ( diff --git a/packages/web/src/common/store/oauth/sagas.ts b/packages/web/src/common/store/oauth/sagas.ts index c4d3627609..ca2c50adbb 100644 --- a/packages/web/src/common/store/oauth/sagas.ts +++ b/packages/web/src/common/store/oauth/sagas.ts @@ -16,9 +16,6 @@ import { RequestTwitterAuthSuccessMessage } from 'services/native-mobile-interface/oauth' -import mobileSagas from './mobileSagas' - -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE const IDENTITY_SERVICE = process.env.REACT_APP_IDENTITY_SERVICE const INSTAGRAM_APP_ID = process.env.REACT_APP_INSTAGRAM_APP_ID const INSTAGRAM_REDIRECT_URL = @@ -296,8 +293,7 @@ function* watchInstagramAuth() { } const sagas = () => { - const sagas = [watchTwitterAuth, watchInstagramAuth] - return NATIVE_MOBILE ? sagas.concat(mobileSagas()) : sagas + return [watchTwitterAuth, watchInstagramAuth] } export default sagas diff --git a/packages/web/src/common/store/pages/signon/reducer.js b/packages/web/src/common/store/pages/signon/reducer.js index 769cff51c8..577d919cca 100644 --- a/packages/web/src/common/store/pages/signon/reducer.js +++ b/packages/web/src/common/store/pages/signon/reducer.js @@ -1,4 +1,3 @@ -import { getIsIOS } from 'utils/browser' import { isMobile } from 'utils/clientUtil' import { FEED_PAGE } from 'utils/route' @@ -38,8 +37,6 @@ import { } from './actions' import { Pages, FollowArtistsCategory } from './types' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const createTextField = () => ({ value: '', error: '', @@ -114,10 +111,8 @@ const actionsMap = { newPage = Pages.FOLLOW break case Pages.FOLLOW: { - if (!NATIVE_MOBILE && !isMobile()) { + if (!isMobile()) { newPage = Pages.APP_CTA - } else if (NATIVE_MOBILE && getIsIOS()) { - newPage = Pages.NOTIFICATION_SETTINGS } else { newPage = Pages.LOADING } diff --git a/packages/web/src/common/store/reachability/sagas.ts b/packages/web/src/common/store/reachability/sagas.ts index 03f49a3f6b..cb893a1af9 100644 --- a/packages/web/src/common/store/reachability/sagas.ts +++ b/packages/web/src/common/store/reachability/sagas.ts @@ -1,4 +1,8 @@ -import { reachabilityActions, reachabilitySelectors } from '@audius/common' +import { + reachabilityActions, + reachabilitySelectors, + getContext +} from '@audius/common' import { takeEvery, call, put, race, select, delay } from 'typed-redux-saga' import { MessageType, Message } from 'services/native-mobile-interface/types' @@ -6,7 +10,6 @@ import { isMobile } from 'utils/clientUtil' const { getIsReachable } = reachabilitySelectors const { setUnreachable, setReachable } = reachabilityActions -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE const REACHABILITY_URL = process.env.REACT_APP_REACHABILITY_URL // Property values borrowed from @@ -63,7 +66,8 @@ function* updateReachability(isReachable: boolean) { } function* reachabilityPollingDaemon() { - if (NATIVE_MOBILE) { + const isNativeMobile = yield* getContext('isNativeMobile') + if (isNativeMobile) { // Native mobile: use the system connectivity checks console.log('polling') yield* takeEvery( diff --git a/packages/web/src/common/store/social/tracks/sagas.ts b/packages/web/src/common/store/social/tracks/sagas.ts index b78071fd0f..183170867c 100644 --- a/packages/web/src/common/store/social/tracks/sagas.ts +++ b/packages/web/src/common/store/social/tracks/sagas.ts @@ -33,8 +33,6 @@ const { getTrack, getTracks } = cacheTracksSelectors const { getUserId, getUserHandle } = accountSelectors -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - /* REPOST TRACK */ export function* watchRepostTrack() { yield* takeEvery(socialActions.REPOST_TRACK, repostTrackAsync) @@ -585,7 +583,8 @@ export function* watchRecordListen() { yield* takeEvery( socialActions.RECORD_LISTEN, function* (action: ReturnType) { - if (NATIVE_MOBILE) return + const isNativeMobile = yield* getContext('isNativeMobile') + if (isNativeMobile) return console.debug('Listen recorded for track', action.trackId) yield* waitForAccount() diff --git a/packages/web/src/components/animated-switch/AnimatedSwitch.tsx b/packages/web/src/components/animated-switch/AnimatedSwitch.tsx index 61a8101057..1a54ca06fa 100644 --- a/packages/web/src/components/animated-switch/AnimatedSwitch.tsx +++ b/packages/web/src/components/animated-switch/AnimatedSwitch.tsx @@ -4,7 +4,6 @@ import { ReactNode, useRef, useState, - useCallback, CSSProperties } from 'react' @@ -16,19 +15,12 @@ import { getIsIOS } from 'utils/browser' import { SIGN_IN_PAGE, SIGN_UP_PAGE, - TRENDING_PAGE, NOTIFICATION_PAGE, - FEED_PAGE, - SAVED_PAGE, - EXPLORE_PAGE, - profilePage, getPathname } from 'utils/route' import { RouterContext, SlideDirection } from './RouterContextProvider' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const DISABLED_PAGES = new Set([SIGN_IN_PAGE, SIGN_UP_PAGE]) if (!getIsIOS()) { @@ -109,34 +101,10 @@ const AnimatedSwitch = ({ } }, [stackReset, setStackReset, setAnimation, setIsStackResetting]) - // If on android & navigating between the bottom bar route, do not animate - const isBaseRoute = useCallback( - (udpatedRoute: string) => { - if (getIsIOS() || !NATIVE_MOBILE) return false - - const userProfilePage = handle ? profilePage(handle) : '' - const baseRoutes = [ - TRENDING_PAGE, - FEED_PAGE, - SAVED_PAGE, - EXPLORE_PAGE, - userProfilePage - ] - return ( - baseRoutes.includes(udpatedRoute) && - baseRoutes.includes(getPathname(location)) - ) - }, - [location, handle] - ) - // Go back a page useEffect(() => { window.onpopstate = (e: any) => { - if ( - !getIsStackResetting() && - !isBaseRoute(getPathname(e.target.location)) - ) { + if (!getIsStackResetting()) { setAnimation( slideDirection === SlideDirection.FROM_LEFT ? slideInRightTransition @@ -146,7 +114,7 @@ const AnimatedSwitch = ({ setAnimation(noTransition) } } - }, [setAnimation, slideDirection, getIsStackResetting, isBaseRoute]) + }, [setAnimation, slideDirection, getIsStackResetting]) useEffect(() => { if ( diff --git a/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx b/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx index 7166d58074..7ee75790c0 100644 --- a/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx +++ b/packages/web/src/components/app-redirect-popover/AppRedirectListener.tsx @@ -17,7 +17,6 @@ import { type AppRedirectListenerProps = ReturnType const EMBED_HASH = '#embed' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE /** * `AppRedirectListener` listens to redirects from the `AppRedirectPopover`. @@ -49,15 +48,13 @@ const AppRedirectListener = ({ goToRoute }: AppRedirectListenerProps) => { return } - if (!NATIVE_MOBILE) { - const os = getMobileOS() - if (os === MobileOS.IOS) { - window.location.href = IOS_APP_STORE_LINK - } else if (os === MobileOS.ANDROID) { - window.location.href = ANDROID_PLAY_STORE_LINK - } else { - window.location.href = IOS_WEBSITE_STORE_LINK - } + const os = getMobileOS() + if (os === MobileOS.IOS) { + window.location.href = IOS_APP_STORE_LINK + } else if (os === MobileOS.ANDROID) { + window.location.href = ANDROID_PLAY_STORE_LINK + } else { + window.location.href = IOS_WEBSITE_STORE_LINK } }, [pathname, goToRoute]) diff --git a/packages/web/src/components/app-redirect-popover/components/AppRedirectPopover.tsx b/packages/web/src/components/app-redirect-popover/components/AppRedirectPopover.tsx index b4c998b146..030051ac5b 100644 --- a/packages/web/src/components/app-redirect-popover/components/AppRedirectPopover.tsx +++ b/packages/web/src/components/app-redirect-popover/components/AppRedirectPopover.tsx @@ -10,8 +10,6 @@ import { APP_REDIRECT, getPathname, SIGN_UP_PAGE } from 'utils/route' import styles from './AppRedirectPopover.module.css' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const messages = { openInApp: 'Open in Audius App', notNow: 'Not Now' @@ -100,7 +98,7 @@ const AppRedirectPopover = ({ enablePopover && setTimeout(() => setAnimDelay(true), 500) }, [enablePopover]) - const shouldShow = animDelay && !isDismissed && isMobile() && !NATIVE_MOBILE + const shouldShow = animDelay && !isDismissed && isMobile() useEffect(() => { shouldShow && incrementScroll() diff --git a/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx b/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx index b0829e4053..1d00771de7 100644 --- a/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx +++ b/packages/web/src/components/collectibles/components/CollectibleDetailsModal.tsx @@ -54,8 +54,6 @@ const { setCollectible } = collectibleDetailsUIActions const { getCollectibleDetails, getCollectible } = collectibleDetailsUISelectors const getAccountUser = accountSelectors.getAccountUser -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const MODEL_VIEWER_SCRIPT_URL = 'https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js' @@ -418,7 +416,7 @@ const CollectibleDetailsModal = ({ diff --git a/packages/web/src/components/collectibles/components/CollectiblesPage.tsx b/packages/web/src/components/collectibles/components/CollectiblesPage.tsx index d2524969f0..c709841903 100644 --- a/packages/web/src/components/collectibles/components/CollectiblesPage.tsx +++ b/packages/web/src/components/collectibles/components/CollectiblesPage.tsx @@ -69,8 +69,6 @@ const BASE_EMBED_URL = `${BASE_GA_URL}/embed` const VISIBLE_COLLECTIBLES_DROPPABLE_ID = 'visible-collectibles-droppable' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - export const collectibleMessages = { title: 'COLLECTIBLES', subtitlePrefix: 'A collection of NFT collectibles owned and created by ', @@ -759,23 +757,20 @@ const CollectiblesPage = (props: CollectiblesPageProps) => { - - {!NATIVE_MOBILE ? ( - setShowUseDesktopDrawer(false)} - > -
- -
- {collectibleMessages.editCollectibles} -
-
- {collectibleMessages.editInBrowser} -
+ setShowUseDesktopDrawer(false)} + > +
+ +
+ {collectibleMessages.editCollectibles} +
+
+ {collectibleMessages.editInBrowser}
- - ) : null} +
+
) } diff --git a/packages/web/src/components/drawer/Drawer.module.css b/packages/web/src/components/drawer/Drawer.module.css index c07922b770..0436dd7129 100644 --- a/packages/web/src/components/drawer/Drawer.module.css +++ b/packages/web/src/components/drawer/Drawer.module.css @@ -57,10 +57,10 @@ * When testing this, make sure to test Safari embedded inside Twitter. */ @supports (-webkit-overflow-scrolling: touch) { - .drawer:not(.native):not(.fullDrawer).isOpen { + .drawer:not(.fullDrawer).isOpen { top: calc(100vh - 100px); } - .drawer:not(.native):not(.fullDrawer):not(.isOpen) { + .drawer:not(.fullDrawer):not(.isOpen) { top: calc(100vh + 100px); } } diff --git a/packages/web/src/components/drawer/Drawer.tsx b/packages/web/src/components/drawer/Drawer.tsx index db9ffe7203..6f1316d29f 100644 --- a/packages/web/src/components/drawer/Drawer.tsx +++ b/packages/web/src/components/drawer/Drawer.tsx @@ -11,8 +11,6 @@ import { usePortal } from 'hooks/usePortal' import styles from './Drawer.module.css' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - // Fraction of swipe up to fade (1 / FADE_FRACTION_DENOMINATOR) const FADE_FRACTION_DENOMINATOR = 2 @@ -298,10 +296,7 @@ const DraggableDrawer = ({ return ( - {/** Don't render tracklist on native mobile. Errors - * get thrown because of the null renderer - */} - {!IS_NATIVE_MOBILE && trackList && trackList.length > 0 && ( + {trackList && trackList.length > 0 && ( { - try { - if (onClick) onClick() - const message = new RequestInstagramAuthMessage(INSTAGRAM_AUTHORIZE_URL) - message.send() - const response = await message.receive() - if (response.code) { - return await getProfile(response.code) - } else { - onFailure(new Error('Unable to retrieve information')) - } - } catch (error) { - onFailure(error) - } - }, [onClick, onFailure, getProfile]) - - const onButtonClick = useCallback( + const handleClick = useCallback( (e: MouseEvent) => { e.preventDefault() if (onClick) onClick() @@ -248,7 +230,7 @@ const InstagramAuth = ({ return (
{ }, [setIsOpen]) return ( - +
diff --git a/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx b/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx index 22c7ff0977..f858fff127 100644 --- a/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx +++ b/packages/web/src/components/nav/mobile/ConnectedBottomBar.tsx @@ -26,9 +26,7 @@ import { } from 'utils/route' import { isDarkMode, isMatrix } from 'utils/theme/theme' const { setTab } = explorePageActions -const getUserHandle = accountSelectors.getUserHandle - -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE +const { getUserHandle } = accountSelectors type ConnectedBottomBarProps = ReturnType & ReturnType & @@ -59,17 +57,6 @@ const ConnectedNavBar = ({ if (navRoutes.has(currentRoute)) { setNavRoute(currentRoute) } - - // If we are in native mobile and we entered the app via notification directly, - // update the current route to the current page so that none of the - // nav bar items are highlighted - if ( - NATIVE_MOBILE && - // @ts-ignore - history.location.state?.fromNativeNotifications - ) { - setNavRoute(currentRoute) - } } const goToFeed = useCallback(() => { diff --git a/packages/web/src/components/now-playing/NowPlaying.module.css b/packages/web/src/components/now-playing/NowPlaying.module.css index a7b76c3333..5e3c4b3b15 100644 --- a/packages/web/src/components/now-playing/NowPlaying.module.css +++ b/packages/web/src/components/now-playing/NowPlaying.module.css @@ -18,15 +18,11 @@ /* Fixes positioning on android chrome */ @supports (-webkit-appearance: none) { - .nowPlaying:not(.native) { + .nowPlaying { max-height: calc(100vh - 56px); } } -.nowPlaying.native { - height: 100vh; -} - .header { width: 100%; position: relative; diff --git a/packages/web/src/components/now-playing/NowPlaying.tsx b/packages/web/src/components/now-playing/NowPlaying.tsx index 7fd4e53491..a2de4f175d 100644 --- a/packages/web/src/components/now-playing/NowPlaying.tsx +++ b/packages/web/src/components/now-playing/NowPlaying.tsx @@ -64,8 +64,6 @@ const { next, pause, play, previous, repeat, shuffle } = queueActions const getDominantColorsByTrack = averageColorSelectors.getDominantColorsByTrack const getUserId = accountSelectors.getUserId -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - type OwnProps = { onClose: () => void } @@ -361,11 +359,7 @@ const NowPlaying = g( const darkMode = isDarkMode() return ( -
+
diff --git a/packages/web/src/components/now-playing/NowPlayingDrawer.module.css b/packages/web/src/components/now-playing/NowPlayingDrawer.module.css index fad889c5e2..7dcc0115f9 100644 --- a/packages/web/src/components/now-playing/NowPlayingDrawer.module.css +++ b/packages/web/src/components/now-playing/NowPlayingDrawer.module.css @@ -24,10 +24,6 @@ } } -.drawer.native { - height: 100vh; -} - .playBar { position: absolute; top: 0; diff --git a/packages/web/src/components/now-playing/NowPlayingDrawer.tsx b/packages/web/src/components/now-playing/NowPlayingDrawer.tsx index abeb9be094..4d1e498c30 100644 --- a/packages/web/src/components/now-playing/NowPlayingDrawer.tsx +++ b/packages/web/src/components/now-playing/NowPlayingDrawer.tsx @@ -1,7 +1,6 @@ import { useEffect, useCallback } from 'react' import { useInstanceVar, nowPlayingUIActions } from '@audius/common' -import cn from 'classnames' import { useDispatch } from 'react-redux' import { useSpring, animated } from 'react-spring' import { useDrag } from 'react-use-gesture' @@ -14,8 +13,6 @@ import NowPlaying from './NowPlaying' import styles from './NowPlayingDrawer.module.css' const { setIsOpen: _setIsNowPlayingOpen } = nowPlayingUIActions -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const DEFAULT_HEIGHT = window.innerHeight // Translation values for a totally hidden drawer @@ -372,9 +369,7 @@ const NowPlayingDrawer = ({ return ( <> { - if (!NATIVE_MOBILE) { - if (open) { - if (value.trimLeft() !== '') { - beginSearch() - } else { - onSearch('') - onClose() - } + const handleClick = () => { + if (open) { + if (value.trimLeft() !== '') { + beginSearch() } else { - onOpen() + onSearch('') + onClose() } + } else { + onOpen() } } @@ -114,10 +110,8 @@ const SearchBar = ({ {...(open ? {} : { disabled: true })} />
{ } return mobile ? ( - !IS_NATIVE_MOBILE ? ( - -
-
-
- -
{messages.title}
-
+ +
+
+
+ +
{messages.title}
- {renderMessage()} - {status === ShareSoundToTiktokModalStatus.SHARE_STARTED ? ( - - ) : ( - renderButton() - )}
- - ) : null + {renderMessage()} + {status === ShareSoundToTiktokModalStatus.SHARE_STARTED ? ( + + ) : ( + renderButton() + )} +
+
) : ( {this.props.text} } - doNativeMobileAuth = async () => { - try { - if (this.props.onClick) this.props.onClick() - const tokenResp = await window.fetch(this.props.requestTokenUrl, { - method: 'POST', - credentials: this.props.credentials, - headers: this.getHeaders() - }) - const tokenRespJson = await tokenResp.json() - let authenticationUrl = `https://api.twitter.com/oauth/authenticate?oauth_token=${tokenRespJson.oauth_token}&force_login=${this.props.forceLogin}` - - if (this.props.screenName) { - authenticationUrl = `${authenticationUrl}&screen_name=${this.props.screenName}` - } - - const message = new RequestTwitterAuthMessage(authenticationUrl) - message.send() - const response = await message.receive() - const { oauthVerifier, oauthToken } = response - if (oauthVerifier && oauthToken) { - return this.getOauthToken(oauthVerifier, oauthToken) - } else { - this.props.onFailure() - } - } catch (err) { - this.props.onFailure(err) - } - } - render() { return (
{ @@ -353,9 +352,7 @@ class App extends Component { if (prevProps.accountStatus === Status.LOADING) { this.pushWithToken(TRENDING_PAGE) // If native mobile, a saga watches for fetch account failure to push route - if (!NATIVE_MOBILE) { - this.props.openSignOn(true, SignOnPages.SIGNIN) - } + this.props.openSignOn(true, SignOnPages.SIGNIN) this.props.updateRouteOnSignUpCompletion(this.state.entryRoute) } else { this.pushWithToken(TRENDING_PAGE) @@ -1007,7 +1004,7 @@ class App extends Component { {/* Mobile-only */} {isMobileClient && } - {shouldShowPopover && isMobileClient && !NATIVE_MOBILE && ( + {shouldShowPopover && isMobileClient && ( { return (
{children}
@@ -172,7 +170,7 @@ export const WalletTile = ({ className }: { className?: string }) => { onClick={onClickConnectWallets} type={ButtonType.GLASS} /> - {mobile && !IS_NATIVE_MOBILE && ( + {mobile && ( )}
diff --git a/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx b/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx index 040a065918..1c4bce49d0 100644 --- a/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/WalletManagementTile.tsx @@ -44,7 +44,6 @@ const messages = { hideAdvanced: 'Hide Advanced', advancedOptions: 'Advanced Options' } -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE const { precalculateSwapFees } = buyAudioActions @@ -125,7 +124,7 @@ const AdvancedWalletActions = () => { leftIcon={} minWidth={200} /> - {mobile && !IS_NATIVE_MOBILE && ( + {mobile && ( )}
diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/RewardsModals.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/RewardsModals.tsx index aba90dcedf..bc8983bd24 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/RewardsModals.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/RewardsModals.tsx @@ -9,8 +9,6 @@ import TransferAudioMobileDrawer from './TransferAudioMobileDrawer' import TrendingRewardsModal from './TrendingRewards' import VerifiedUpload from './VerifiedUpload' -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const HCaptchaModal = lazyWithPreload(() => import('./HCaptchaModal')) const CognitoModal = lazyWithPreload(() => import('./CognitoModal')) @@ -20,16 +18,14 @@ const RewardsModals = () => { return ( <> - {!IS_NATIVE_MOBILE && } + - {!IS_NATIVE_MOBILE && ( - - - - - )} - {!IS_NATIVE_MOBILE && isMobile() && } + + + + + {isMobile() && } ) } diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/TopAPI.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/TopAPI.tsx index d4e3d76b94..08a72c0e07 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/TopAPI.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/TopAPI.tsx @@ -17,8 +17,6 @@ const messages = { button: 'Learn More About The Audius API' } -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const TopAPIBody = () => { const wm = useWithMobileStyle(styles.mobile) @@ -46,7 +44,7 @@ const TopAPIModal = () => { return ( setOpen(false)} title={messages.modalTitle} isFullscreen={false} diff --git a/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx b/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx index f652200ebc..e1519c0bca 100644 --- a/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx +++ b/packages/web/src/pages/audio-rewards-page/components/modals/TrendingRewards.tsx @@ -33,8 +33,6 @@ import styles from './TrendingRewards.module.css' const { getTrendingRewardsModalType } = audioRewardsPageSelectors const { setTrendingRewardsModalType } = audioRewardsPageActions -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const messages = { tracksTitle: 'Top 5 Tracks Each Week Receive 100 $AUDIO', playlistTitle: 'Top 5 Playlists Each Week Receive 100 $AUDIO', @@ -222,7 +220,7 @@ export const TrendingRewardsModal = () => { return ( setOpen(false)} title={

diff --git a/packages/web/src/pages/deactivate-account-page/components/mobile/DeactivateAccountPage.tsx b/packages/web/src/pages/deactivate-account-page/components/mobile/DeactivateAccountPage.tsx index 0114333468..29e7ba5435 100644 --- a/packages/web/src/pages/deactivate-account-page/components/mobile/DeactivateAccountPage.tsx +++ b/packages/web/src/pages/deactivate-account-page/components/mobile/DeactivateAccountPage.tsx @@ -16,8 +16,6 @@ import { import styles from './DeactivateAccountPage.module.css' -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const useMobileNavContext = () => { useMobileHeader({ title: messages.title }) const { setLeft, setRight } = useContext(NavContext)! @@ -49,18 +47,16 @@ export const DeactivateAccountPageMobile = ({ hasDefaultHeader > {children} - {!IS_NATIVE_MOBILE && ( - - )} + ) } diff --git a/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx b/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx index e20a6c68e4..db4adab637 100644 --- a/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx +++ b/packages/web/src/pages/feed-page/components/mobile/FeedPageContent.tsx @@ -24,8 +24,6 @@ import Filters from './FeedFilterButton' import FeedFilterDrawer from './FeedFilterDrawer' import styles from './FeedPageContent.module.css' -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const messages = { title: 'Your Feed' } @@ -106,13 +104,11 @@ const FeedPageMobileContent = ({ canonicalUrl={`${BASE_URL}${FEED_PAGE}`} hasDefaultHeader > - {IS_NATIVE_MOBILE ? null : ( - setModalIsOpen(false)} - /> - )} + setModalIsOpen(false)} + />
{ const client = getClient() const isMobileClient = client === Client.MOBILE - if (NATIVE_NAVIGATION_ENABLED) return null - return ( <> {appModals.map(([modalName, Modal]) => { @@ -67,9 +61,7 @@ const Modals = () => { - {!NATIVE_MOBILE && client !== Client.ELECTRON && ( - - )} + {client !== Client.ELECTRON && } {!isMobileClient && ( <> @@ -86,15 +78,15 @@ const Modals = () => { {isMobileClient && ( <> - {!NATIVE_MOBILE && } + )} - {!NATIVE_MOBILE && } - {!NATIVE_MOBILE ? : null} - {!NATIVE_MOBILE ? : null} + + + ) } diff --git a/packages/web/src/pages/saved-page/SavedPageProvider.tsx b/packages/web/src/pages/saved-page/SavedPageProvider.tsx index f66ea5147c..7630e236fe 100644 --- a/packages/web/src/pages/saved-page/SavedPageProvider.tsx +++ b/packages/web/src/pages/saved-page/SavedPageProvider.tsx @@ -45,8 +45,6 @@ const { makeGetTableMetadatas } = lineupSelectors const { getAccountWithSavedPlaylistsAndAlbums } = accountSelectors -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const messages = { title: 'Favorites', description: "View tracks that you've favorited" @@ -87,9 +85,7 @@ class SavedPage extends PureComponent { } componentWillUnmount() { - if (!IS_NATIVE_MOBILE) { - this.props.resetSavedTracks() - } + this.props.resetSavedTracks() } componentDidUpdate() { diff --git a/packages/web/src/pages/search-page/components/mobile/SearchPageContent.module.css b/packages/web/src/pages/search-page/components/mobile/SearchPageContent.module.css index cbc0fbdaef..dab0bad410 100644 --- a/packages/web/src/pages/search-page/components/mobile/SearchPageContent.module.css +++ b/packages/web/src/pages/search-page/components/mobile/SearchPageContent.module.css @@ -32,10 +32,6 @@ z-index: 1; } -.nativeTabBar { - top: 92px; -} - .spinner { height: 40px; width: 40px; diff --git a/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx b/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx index 628de96315..afbc643b12 100644 --- a/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx +++ b/packages/web/src/pages/search-page/components/mobile/SearchPageContent.tsx @@ -10,7 +10,6 @@ import { searchResultsPageTracksLineupActions as tracksActions, trimToAlphaNumeric } from '@audius/common' -import cn from 'classnames' import { matchPath } from 'react-router' import { Dispatch } from 'redux' @@ -46,8 +45,6 @@ import { import styles from './SearchPageContent.module.css' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - type SearchPageContentProps = { tracks: LineupState<{}> playlists: UserCollection[] @@ -318,17 +315,9 @@ const SearchPageContent = (props: SearchPageContentProps) => { // Set nav header const { setLeft, setCenter, setRight } = useContext(NavContext)! useEffect(() => { - // If native, add the ability to navigate back to the native search - if (NATIVE_MOBILE) { - setLeft(LeftPreset.BACK) - setCenter(CenterPreset.LOGO) - setRight(null) - } else { - // If non-native mobile, show the notification and search icons - setLeft(LeftPreset.NOTIFICATION) - setCenter(CenterPreset.LOGO) - setRight(RightPreset.SEARCH) - } + setLeft(LeftPreset.NOTIFICATION) + setCenter(CenterPreset.LOGO) + setRight(RightPreset.SEARCH) }, [setLeft, setCenter, setRight]) const record = useRecord() @@ -435,13 +424,7 @@ const SearchPageContent = (props: SearchPageContentProps) => { className={styles.header} title={isTagSearch ? messages.tagSearchTitle : messages.title} /> -
- {tabs} -
+
{tabs}
) }, [setHeader, tabs, pathname, isTagSearch]) diff --git a/packages/web/src/pages/settings-page/SettingsPageProvider.tsx b/packages/web/src/pages/settings-page/SettingsPageProvider.tsx index ad61393a89..d063721dd0 100644 --- a/packages/web/src/pages/settings-page/SettingsPageProvider.tsx +++ b/packages/web/src/pages/settings-page/SettingsPageProvider.tsx @@ -5,9 +5,6 @@ import { Theme, accountSelectors, InstagramProfile, - castSelectors, - CastMethod, - castActions, settingsPageSelectors, BrowserNotificationSetting, EmailFrequency, @@ -54,8 +51,6 @@ const { getPushNotificationSettings, getEmailFrequency } = settingsPageSelectors -const { updateMethod } = castActions -const { getMethod: getCastMethod } = castSelectors const { getAccountVerified, @@ -170,13 +165,11 @@ class SettingsPage extends PureComponent< pushNotificationSettings, getNotificationSettings, getPushNotificationSettings, - castMethod, onTwitterLogin, onInstagramLogin, toggleNotificationSetting, togglePushNotificationSetting, updateEmailFrequency, - updateCastMethod, goToRoute, goBack, recordSignOut, @@ -220,11 +213,7 @@ class SettingsPage extends PureComponent< signOut } - const mobileProps = { - subPage, - castMethod, - updateCastMethod - } + const mobileProps = { subPage } return } @@ -246,7 +235,6 @@ function makeMapStateToProps() { emailFrequency: getEmailFrequency(state), notificationSettings: getBrowserNotificationSettings(state), pushNotificationSettings: getPushNotificationSettings(state), - castMethod: getCastMethod(state), tier: getTier(state, { userId }).tier } } @@ -298,9 +286,6 @@ function mapDispatchToProps(dispatch: Dispatch) { dispatch(settingPageActions.updateEmailFrequency(frequency)), goToRoute: (route: string) => dispatch(pushRoute(route)), goBack: () => dispatch(goBack()), - updateCastMethod: (castMethod: CastMethod) => { - dispatch(updateMethod({ method: castMethod })) - }, recordThemeChange: (themeSettings: string) => { const theme = themeSettings === Theme.DEFAULT diff --git a/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.module.css b/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.module.css index 2896101e3e..57e3a70352 100644 --- a/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.module.css +++ b/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.module.css @@ -3,22 +3,3 @@ width: 100%; user-select: none; } - -.toggleContainer { - display: inline-flex; - justify-content: space-between; - align-items: center; - width: 100%; -} - -.bodyText { - font-size: var(--font-s); - font-weight: var(--font-medium); - line-height: 18px; - color: var(--neutral-light-4); - transition: color 0.17s ease-in-out; -} - -.bodyText.isOn { - color: var(--neutral); -} diff --git a/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx b/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx index 5d563ab0aa..ab87521b59 100644 --- a/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx +++ b/packages/web/src/pages/settings-page/components/mobile/NotificationsSettingsPage.tsx @@ -1,58 +1,15 @@ -import { useCallback } from 'react' - -import { EmailFrequency, PushNotificationSetting } from '@audius/common' -import cn from 'classnames' +import { EmailFrequency } from '@audius/common' import TabSlider from 'components/data-entry/TabSlider' import GroupableList from 'components/groupable-list/GroupableList' import Grouping from 'components/groupable-list/Grouping' import Row from 'components/groupable-list/Row' import Page from 'components/page/Page' -import Switch from 'components/switch/Switch' import styles from './NotificationsSettingsPage.module.css' import { SettingsPageProps } from './SettingsPage' import settingsPageStyles from './SettingsPage.module.css' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - -const ToggleNotification = ({ - text, - isOn, - type, - onToggle, - isDisabled -}: { - text: string - isOn: boolean - type: PushNotificationSetting - onToggle: (type: PushNotificationSetting, toggle: boolean) => void - isDisabled: boolean -}) => { - const handleToggle = useCallback(() => { - onToggle(type, !isOn) - }, [isOn, onToggle, type]) - - return ( -
-
- {text} -
-
- -
-
- ) -} - const messages = { title: 'Notifications', enablePn: 'Enable Push Notifications', @@ -72,47 +29,9 @@ const emailOptions = [ ] const NotificationsSettingsPage = ({ - notificationSettings, emailFrequency, - pushNotificationSettings, - togglePushNotificationSetting, updateEmailFrequency }: SettingsPageProps) => { - const notificationToggles = [ - { - text: messages.enablePn, - isOn: pushNotificationSettings[PushNotificationSetting.MobilePush], - type: PushNotificationSetting.MobilePush - }, - { - text: messages.milestones, - isOn: pushNotificationSettings[ - PushNotificationSetting.MilestonesAndAchievements - ], - type: PushNotificationSetting.MilestonesAndAchievements - }, - { - text: messages.followers, - isOn: pushNotificationSettings[PushNotificationSetting.Followers], - type: PushNotificationSetting.Followers - }, - { - text: messages.reposts, - isOn: pushNotificationSettings[PushNotificationSetting.Reposts], - type: PushNotificationSetting.Reposts - }, - { - text: messages.favorites, - isOn: pushNotificationSettings[PushNotificationSetting.Favorites], - type: PushNotificationSetting.Favorites - }, - { - text: messages.remixes, - isOn: pushNotificationSettings[PushNotificationSetting.Remixes], - type: PushNotificationSetting.Remixes - } - ] - return (
- {NATIVE_MOBILE && ( - // The user should be able to configure push notifications only w/in - // an app-context, not the mobile website. - - {notificationToggles.map((notification) => ( - - - - ))} - - )} void getPushNotificationSettings: () => void @@ -96,7 +92,6 @@ type OwnProps = { isOn: boolean ) => void updateEmailFrequency: (frequency: EmailFrequency) => void - updateCastMethod: (castMethod: CastMethod) => void recordSignOut: (callback?: () => void) => void showMatrix: boolean } @@ -121,8 +116,6 @@ const SettingsPage = (props: SettingsPageProps) => { theme, toggleTheme, goToRoute, - castMethod, - updateCastMethod, getNotificationSettings, getPushNotificationSettings, showMatrix @@ -255,34 +248,6 @@ const SettingsPage = (props: SettingsPageProps) => { > {renderThemeSlider()} - {isIOS && NATIVE_MOBILE && ( - - } - title='Cast to Devices' - body={messages.cast} - > - { - updateCastMethod(method) - }} - /> - - )} {content} - ) : null + ) } function mapStateToProps(state: AppState) { diff --git a/packages/web/src/pages/sign-on/components/mobile/InitialPage.module.css b/packages/web/src/pages/sign-on/components/mobile/InitialPage.module.css index 43803a5caa..24ec23c5b2 100644 --- a/packages/web/src/pages/sign-on/components/mobile/InitialPage.module.css +++ b/packages/web/src/pages/sign-on/components/mobile/InitialPage.module.css @@ -17,11 +17,6 @@ box-shadow: 0 2px 25px -5px rgba(17, 17, 34, 0.5); } -.native .topSection { - height: 58vh; - min-height: 420px; -} - .topSectionTransition { position: absolute; top: 0; @@ -63,11 +58,6 @@ } } -.native .bottomContainer { - padding-bottom: 0px; - padding-bottom: env(safe-area-inset-bottom, 0px) !important; -} - /* */ .logo { height: 51px; diff --git a/packages/web/src/pages/sign-on/components/mobile/InitialPage.tsx b/packages/web/src/pages/sign-on/components/mobile/InitialPage.tsx index 92505ca883..269c0d86bc 100644 --- a/packages/web/src/pages/sign-on/components/mobile/InitialPage.tsx +++ b/packages/web/src/pages/sign-on/components/mobile/InitialPage.tsx @@ -23,8 +23,6 @@ import { useDelayedEffect } from 'hooks/useDelayedEffect' import styles from './InitialPage.module.css' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const messages = { title: 'Sign Up For Audius', header1: 'Stream the music you love.', @@ -320,11 +318,7 @@ export const InitialPage = ({ }) }, [topAreaRef, bottomLinkRef]) return ( -
+
{isSignIn ? ( diff --git a/packages/web/src/root.tsx b/packages/web/src/root.tsx index 6ef5a95d34..5b1cabe800 100644 --- a/packages/web/src/root.tsx +++ b/packages/web/src/root.tsx @@ -8,8 +8,6 @@ import { getPathname, HOME_PAGE, publicSiteRoutes } from 'utils/route' import Dapp from './app' -const REACT_APP_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - const NoConnectivityPage = lazy( () => import('components/no-connectivity-page/NoConnectivityPage') ) @@ -50,12 +48,7 @@ const Root = () => { const [shouldShowPopover, setShouldShowPopover] = useState(true) const shouldRedirectToApp = foundUser && !isPublicSiteSubRoute() - if ( - renderPublicSite && - !clientIsElectron && - !REACT_APP_NATIVE_MOBILE && - !shouldRedirectToApp - ) { + if (renderPublicSite && !clientIsElectron && !shouldRedirectToApp) { return ( }> { const mobileOS = getMobileOS() const isMobile = getIsMobile() const isElectron = getIsElectron() - if (NATIVE_MOBILE) { - if (mobileOS === MobileOS.ANDROID) { - return 'Android App' - } else if (mobileOS === MobileOS.IOS) { - return 'iOS App' - } - return 'Unknown App' - } else if (isMobile) { + if (isMobile) { if (mobileOS === MobileOS.ANDROID) { return 'Android Web' } else if (mobileOS === MobileOS.IOS) { diff --git a/packages/web/src/services/audio-player/NativeMobileAudio.ts b/packages/web/src/services/audio-player/NativeMobileAudio.ts deleted file mode 100644 index 88c89df64b..0000000000 --- a/packages/web/src/services/audio-player/NativeMobileAudio.ts +++ /dev/null @@ -1,15 +0,0 @@ -export class NativeMobileAudio { - audio = null as any - audioCtx = null - load = () => {} - play = () => {} - pause = () => {} - stop = () => {} - seek = () => {} - setVolume = () => null - isBuffering = () => false - getPosition = async () => 0 - getDuration = () => 0 - onBufferingChange = () => {} - onError = () => {} -} diff --git a/packages/web/src/services/audio-player/index.ts b/packages/web/src/services/audio-player/index.ts index fb8548efbe..59913d137c 100644 --- a/packages/web/src/services/audio-player/index.ts +++ b/packages/web/src/services/audio-player/index.ts @@ -1,8 +1,3 @@ import { AudioPlayer } from './AudioPlayer' -import { NativeMobileAudio } from './NativeMobileAudio' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - -export const audioPlayer = NATIVE_MOBILE - ? new NativeMobileAudio() - : new AudioPlayer() +export const audioPlayer = new AudioPlayer() diff --git a/packages/web/src/services/audius-backend/audius-backend-instance.ts b/packages/web/src/services/audius-backend/audius-backend-instance.ts index 6c1d006fb3..a3df35315b 100644 --- a/packages/web/src/services/audius-backend/audius-backend-instance.ts +++ b/packages/web/src/services/audius-backend/audius-backend-instance.ts @@ -33,12 +33,7 @@ export const audiusBackendInstance = audiusBackend({ ethRegistryAddress: process.env.REACT_APP_ETH_REGISTRY_ADDRESS, ethTokenAddress: process.env.REACT_APP_ETH_TOKEN_ADDRESS, getFeatureEnabled, - getHostUrl: () => { - const nativeMobile = process.env.REACT_APP_NATIVE_MOBILE === 'true' - return nativeMobile && process.env.REACT_APP_ENVIRONMENT === 'production' - ? `${process.env.REACT_APP_PUBLIC_PROTOCOL}//${process.env.REACT_APP_PUBLIC_HOSTNAME}` - : window.location.origin - }, + getHostUrl: () => window.location.origin, getLibs: () => import('@audius/sdk/dist/legacy'), getWeb3Config: async ( libs, @@ -90,7 +85,7 @@ export const audiusBackendInstance = audiusBackend({ isMobile: isMobile(), legacyUserNodeUrl: process.env.REACT_APP_LEGACY_USER_NODE, monitoringCallbacks, - nativeMobile: process.env.REACT_APP_NATIVE_MOBILE === 'true', + nativeMobile: false, onLibsInit: (libs: AudiusLibs) => { window.audiusLibs = libs const event = new CustomEvent(LIBS_INITTED_EVENT) diff --git a/packages/web/src/utils/browserNotifications.ts b/packages/web/src/utils/browserNotifications.ts index fb3227a5e7..896df933c3 100644 --- a/packages/web/src/utils/browserNotifications.ts +++ b/packages/web/src/utils/browserNotifications.ts @@ -35,22 +35,15 @@ declare global { * */ -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE const basename = process.env.PUBLIC_URL const fcmWebPushPublicKey = process.env.REACT_APP_FCM_PUSH_PUBLIC_KEY as string const safariWebPushID = process.env.REACT_APP_SAFARI_WEB_PUSH_ID const applicationServerPublicKey = fcmWebPushPublicKey export const isPushManagerAvailable = - !isElectron() && - !NATIVE_MOBILE && - 'serviceWorker' in navigator && - 'PushManager' in window + !isElectron() && 'serviceWorker' in navigator && 'PushManager' in window export const isSafariPushAvailable = - !isElectron() && - !NATIVE_MOBILE && - 'safari' in window && - 'pushNotification' in window.safari + !isElectron() && 'safari' in window && 'pushNotification' in window.safari export const isBrowserPushAvailable = isPushManagerAvailable || isSafariPushAvailable diff --git a/packages/web/src/utils/clientUtil.ts b/packages/web/src/utils/clientUtil.ts index d789127ec0..215a22356d 100644 --- a/packages/web/src/utils/clientUtil.ts +++ b/packages/web/src/utils/clientUtil.ts @@ -10,11 +10,7 @@ declare global { } } -const IS_NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - export const isMobile = () => { - // If we are running with the mobile env flag set, short-circuit to `true` - if (IS_NATIVE_MOBILE) return true let check = false ;(function (a) { if ( diff --git a/packages/web/src/utils/clipboardUtil.ts b/packages/web/src/utils/clipboardUtil.ts index fc8cc4c689..1ae60634c4 100644 --- a/packages/web/src/utils/clipboardUtil.ts +++ b/packages/web/src/utils/clipboardUtil.ts @@ -1,6 +1,5 @@ const PUBLIC_PROTOCOL = process.env.REACT_APP_PUBLIC_PROTOCOL const PUBLIC_HOSTNAME = process.env.REACT_APP_PUBLIC_HOSTNAME -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) @@ -37,7 +36,7 @@ export const getCopyableLink = (link: string) => { const protocol = window.location.protocol const hostname = window.location.host // host instead of hostname to work with ports besides 80 - if (protocol !== 'audius:' && !NATIVE_MOBILE) { + if (protocol !== 'audius:') { return `${protocol}//${hostname}${link}` } else { return `${PUBLIC_PROTOCOL}//${PUBLIC_HOSTNAME}${link}` @@ -52,4 +51,4 @@ export const copyLinkToClipboard = (link: string) => { } // @ts-ignore: Navigator's share exists on newer browsers -export const isShareToastDisabled = !!navigator.share || !!NATIVE_MOBILE +export const isShareToastDisabled = !!navigator.share diff --git a/packages/web/src/utils/gdpr.ts b/packages/web/src/utils/gdpr.ts index 6e185011aa..83b151e633 100644 --- a/packages/web/src/utils/gdpr.ts +++ b/packages/web/src/utils/gdpr.ts @@ -12,7 +12,6 @@ export const shouldShowCookieBanner = async (): Promise => { if ( process.env.NODE_ENV === 'production' && process.env.REACT_APP_ENVIRONMENT === 'production' && - !process.env.REACT_APP_NATIVE_MOBILE ) { const isDimissed = localStorage.getItem(DISMISSED_COOKIE_BANNER_KEY) if (isDimissed) return false diff --git a/packages/web/src/utils/logger.js b/packages/web/src/utils/logger.js index 622fdfb493..d98469028d 100644 --- a/packages/web/src/utils/logger.js +++ b/packages/web/src/utils/logger.js @@ -2,11 +2,7 @@ const preserveLogs = window.localStorage && window.localStorage.getItem('preserve-logs') export const storeLogger = (store) => { - if ( - process.env.REACT_APP_ENVIRONMENT === 'production' && - !process.env.REACT_APP_NATIVE_MOBILE && - !preserveLogs - ) { + if (process.env.REACT_APP_ENVIRONMENT === 'production' && !preserveLogs) { console.log('%cStop!', 'color: red; font-size: 56px; font-weight: bold;') console.log( `%cThis is a browser feature intended for developers. If someone told you to copy-paste something here to enable a feature or "hack" someone's account, it is a scam and will give them access to your Audius account.`, diff --git a/packages/web/src/utils/sagaPollingDaemons.ts b/packages/web/src/utils/sagaPollingDaemons.ts index da0aeac38b..e3cdd0a979 100644 --- a/packages/web/src/utils/sagaPollingDaemons.ts +++ b/packages/web/src/utils/sagaPollingDaemons.ts @@ -6,8 +6,6 @@ import { getLocationPathname } from 'store/routing/selectors' import { isElectron } from './clientUtil' -const NATIVE_MOBILE = process.env.REACT_APP_NATIVE_MOBILE - /** * Starts a polling daemon that triggers an action once every delay period if the tab/app is in the foreground/focus * @param action The action to "fire" when poll triggers @@ -50,22 +48,6 @@ export function* foregroundPollingDaemon( } function createVisibilityChangeChannel() { - if (NATIVE_MOBILE) { - return eventChannel((emitter) => { - // The focus and visibitychange events are wonky on native mobile webviews, - // so poll for visiblity change instead - let lastHidden = true - const interval = setInterval(() => { - if (!document.hidden && lastHidden) { - emitter(true) - } - lastHidden = document.hidden - }, 500) - return () => { - clearInterval(interval) - } - }) - } return eventChannel((emitter) => { const handleVisibilityChange = () => { if (!document.hidden) { From 8b9f87dbc6ec2108245c01ca19294bc4c131d7ee Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 9 Sep 2022 17:22:15 -0700 Subject: [PATCH 2/4] Fixes --- .../ChallengeRewardsDrawerProvider.tsx | 4 ++-- .../mobile/src/screens/audio-screen/ChallengeRewards.tsx | 5 +++-- .../pages/settings-page/components/mobile/SettingsPage.tsx | 2 -- packages/web/src/utils/gdpr.ts | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx index ff94acb62e..5a898ff1aa 100644 --- a/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx +++ b/packages/mobile/src/components/challenge-rewards-drawer/ChallengeRewardsDrawerProvider.tsx @@ -1,6 +1,6 @@ import { useCallback, useContext, useEffect } from 'react' -import type { Maybe } from '@audius/common' +import type { Maybe, CommonState } from '@audius/common' import { IntKeys, StringKeys, @@ -48,7 +48,7 @@ export const ChallengeRewardsDrawerProvider = () => { const dispatch = useDispatch() const { onClose } = useDrawerState(MODAL_NAME) const modalType = useSelector(getChallengeRewardsModalType) - const userChallenges = useSelector((state) => + const userChallenges = useSelector((state: CommonState) => getOptimisticUserChallenges(state, true) ) diff --git a/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx b/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx index d1c9f934c3..fb010889f7 100644 --- a/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx +++ b/packages/mobile/src/screens/audio-screen/ChallengeRewards.tsx @@ -2,7 +2,8 @@ import { useEffect, useState } from 'react' import type { ChallengeRewardID, - ChallengeRewardsModalType + ChallengeRewardsModalType, + CommonState } from '@audius/common' import { removeNullable, @@ -70,7 +71,7 @@ export const ChallengeRewards = () => { const userChallengesLoading = useSelector(getUserChallengesLoading) const userChallenges = useSelector(getUserChallenges) - const optimisticUserChallenges = useSelector((state) => + const optimisticUserChallenges = useSelector((state: CommonState) => getOptimisticUserChallenges(state, true) ) const [haveChallengesLoaded, setHaveChallengesLoaded] = useState(false) diff --git a/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx b/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx index 32e6a2e348..685cac0118 100644 --- a/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx +++ b/packages/web/src/pages/settings-page/components/mobile/SettingsPage.tsx @@ -25,7 +25,6 @@ import NavContext, { LeftPreset } from 'components/nav/store/context' import Page from 'components/page/Page' import useScrollToTop from 'hooks/useScrollToTop' import { useUserProfilePicture } from 'hooks/useUserProfilePicture' -import { getIsIOS } from 'utils/browser' import { ACCOUNT_SETTINGS_PAGE, HISTORY_PAGE, @@ -165,7 +164,6 @@ const SettingsPage = (props: SettingsPageProps) => { const SubPageComponent = SubPages[subPage] return } - const isIOS = getIsIOS() const renderThemeSlider = () => { const options = [ diff --git a/packages/web/src/utils/gdpr.ts b/packages/web/src/utils/gdpr.ts index 83b151e633..32e21bc514 100644 --- a/packages/web/src/utils/gdpr.ts +++ b/packages/web/src/utils/gdpr.ts @@ -11,7 +11,7 @@ export const getIsInEU = async () => { export const shouldShowCookieBanner = async (): Promise => { if ( process.env.NODE_ENV === 'production' && - process.env.REACT_APP_ENVIRONMENT === 'production' && + process.env.REACT_APP_ENVIRONMENT === 'production' ) { const isDimissed = localStorage.getItem(DISMISSED_COOKIE_BANNER_KEY) if (isDimissed) return false From dd600b52581050fcf07ad1949083df1d17790bab Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 9 Sep 2022 17:24:15 -0700 Subject: [PATCH 3/4] Remove configs --- packages/web/.env/.env.mobile.prod | 1 - packages/web/.env/.env.mobile.stage | 1 - packages/web/package.json | 6 ------ 3 files changed, 8 deletions(-) delete mode 100644 packages/web/.env/.env.mobile.prod delete mode 100644 packages/web/.env/.env.mobile.stage diff --git a/packages/web/.env/.env.mobile.prod b/packages/web/.env/.env.mobile.prod deleted file mode 100644 index 205c3a54fe..0000000000 --- a/packages/web/.env/.env.mobile.prod +++ /dev/null @@ -1 +0,0 @@ -PORT=3012 diff --git a/packages/web/.env/.env.mobile.stage b/packages/web/.env/.env.mobile.stage deleted file mode 100644 index 5808dc6a62..0000000000 --- a/packages/web/.env/.env.mobile.stage +++ /dev/null @@ -1 +0,0 @@ -PORT=3011 diff --git a/packages/web/package.json b/packages/web/package.json index 23d76bdab1..b09355a00c 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -121,13 +121,9 @@ "publish-scripts": "./scripts/publishScripts.sh", "start": "craco --max-old-space-size=8076 start", "start:dev": "npm run write-sha && npm run configure-local-env && npm run publish-scripts && env-cmd --no-override ./.env/.env.dev.local npm start", - "start:dev:mobile": "env-cmd ./.env/.env.mobile.prod npm run start:dev", "start:dev:cloud": "npm run write-sha && npm run configure-local-env-cloud && npm run publish-scripts && env-cmd --no-override ./.env/.env.dev.local npm start", - "start:dev:mobile:cloud": "env-cmd ./.env/.env.mobile.stage npm run start:dev:cloud", "start:stage": "npm run write-sha && npm run publish-scripts && env-cmd --no-override ./.env/.env.stage npm start", "start:prod": "npm run write-sha && npm run publish-scripts && env-cmd --no-override ./.env/.env.prod npm start", - "start:mobile-prod": "env-cmd ./.env/.env.mobile.prod npm run start:prod", - "start:mobile-stage": "env-cmd ./.env/.env.mobile.stage npm run start:stage", "start:ipfs-prod": "env-cmd ./.env/.env.ipfs.prod npm run start:prod", "start:ipfs-stage": "env-cmd ./.env/.env.ipfs.stage npm run start:stage", "prebuild": "npm run publish-scripts", @@ -136,8 +132,6 @@ "build:stage": "npm run write-sha && env-cmd ./.env/.env.stage npm run build && rm -rf build-staging && mv build build-staging", "build:prod": "npm run write-sha && env-cmd ./.env/.env.prod npm run build && rm -rf build-production && mv build build-production", "build:prod-source-maps": "npm run write-sha && env-cmd ./.env/.env.prod env-cmd ./.env/.env.source-maps npm run build && rm -rf build-production && mv build build-production", - "build:mobile-stage": "env-cmd ./.env/.env.mobile.stage npm run build:stage && rm -rf build-mobile-staging && mv build-staging build-mobile-staging", - "build:mobile-prod": "env-cmd ./.env/.env.mobile.prod npm run build:prod && rm -rf build-mobile-production && mv build-production build-mobile-production", "build:ipfs-stage": "env-cmd ./.env/.env.ipfs.stage npm run build:stage && rm -rf build-mobile-staging && mv build-staging build-ipfs-staging", "build:ipfs-prod": "env-cmd ./.env/.env.ipfs.prod npm run build:prod && rm -rf build-mobile-production && mv build-production build-ipfs-production", "test": "craco test --resetMocks=false", From 259b700c9d17a575b7a19831ab52e39051ffb6ac Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Mon, 12 Sep 2022 09:28:22 -0700 Subject: [PATCH 4/4] Add reachability comments --- packages/web/src/common/store/backend/sagas.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/web/src/common/store/backend/sagas.ts b/packages/web/src/common/store/backend/sagas.ts index f27408afc3..65d44579aa 100644 --- a/packages/web/src/common/store/backend/sagas.ts +++ b/packages/web/src/common/store/backend/sagas.ts @@ -46,6 +46,7 @@ export function* waitForBackendSetup() { } } +// eslint-disable-next-line @typescript-eslint/no-unused-vars function* awaitReachability() { const isNativeMobile = yield* getContext('isNativeMobile') if (!isNativeMobile) return true @@ -64,16 +65,16 @@ function* awaitReachability() { } export function* setupBackend() { - const establishedReachability = yield* call(awaitReachability) - + // Reachability commented out for now until it is properly addressed + // const establishedReachability = yield* call(awaitReachability) // If we couldn't connect, show the error page // and just sit here waiting for reachability. - if (!establishedReachability) { - console.error('No internet connectivity') - yield* put(accountActions.fetchAccountNoInternet()) - yield* take(reachabilityActions.SET_REACHABLE) - console.info('Reconnected') - } + // if (!establishedReachability) { + // console.error('No internet connectivity') + // yield* put(accountActions.fetchAccountNoInternet()) + // yield* take(reachabilityActions.SET_REACHABLE) + // console.info('Reconnected') + // } const apiClient = yield* getContext('apiClient') const fingerprintClient = yield* getContext('fingerprintClient')