Move /platform/detection vars into /env (#9707)

* Add platform vars to env

* Replace /platform/detection with /env
This commit is contained in:
Eric Bailey
2026-01-16 16:28:17 -06:00
committed by GitHub
parent bd510d8468
commit 0589bd7d9e
244 changed files with 789 additions and 789 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
import React from 'react'
import {isWeb} from '#/platform/detection'
import {useSession} from '#/state/session'
import {useActiveStarterPack} from '#/state/shell/starter-pack'
import {IS_WEB} from '#/env'
type State = {
showLoggedOut: boolean
@@ -55,7 +55,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
const [state, setState] = React.useState<State>({
showLoggedOut: shouldShowStarterPack,
requestedAccountSwitchTo: shouldShowStarterPack
? isWeb
? IS_WEB
? 'starterpack'
: 'new'
: undefined,
+3 -3
View File
@@ -1,8 +1,8 @@
import {createContext, useCallback, useContext, useState} from 'react'
import {isWeb} from '#/platform/detection'
import {type FeedDescriptor} from '#/state/queries/post-feed'
import {useSession} from '#/state/session'
import {IS_WEB} from '#/env'
import {account} from '#/storage'
type StateContext = FeedDescriptor | null
@@ -14,7 +14,7 @@ const setContext = createContext<SetContext>((_: string) => {})
setContext.displayName = 'SelectedFeedSetContext'
function getInitialFeed(did?: string): FeedDescriptor | null {
if (isWeb) {
if (IS_WEB) {
if (window.location.pathname === '/') {
const params = new URLSearchParams(window.location.search)
const feedFromUrl = params.get('feed')
@@ -49,7 +49,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
const saveState = useCallback(
(feed: FeedDescriptor) => {
setState(feed)
if (isWeb) {
if (IS_WEB) {
try {
sessionStorage.setItem('lastSelectedHomeFeed', feed)
} catch {}