Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[expo-dev-launcher] Remove debug settings for EAS Updates extension (#…
- Loading branch information
Showing
5 changed files
with
10 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/expo-dev-launcher/android/src/debug/assets/expo_dev_launcher_android.bundle
Large diffs are not rendered by default.
Oops, something went wrong.
38 changes: 3 additions & 35 deletions
38
packages/expo-dev-launcher/bundle/providers/UpdatesConfigProvider.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,14 @@ | ||
import * as React from 'react'; | ||
|
||
import { | ||
EXUpdatesConfig, | ||
updatesConfig as initialUpdatesConfig, | ||
} from '../native-modules/DevLauncherInternal'; | ||
import { EXUpdatesConfig, updatesConfig } from '../native-modules/DevLauncherInternal'; | ||
|
||
const defaultUpdatesConfig: EXUpdatesConfig = { | ||
runtimeVersion: '', | ||
sdkVersion: '', | ||
appId: '', | ||
usesEASUpdates: false, | ||
projectUrl: '', | ||
}; | ||
|
||
const Context = React.createContext<EXUpdatesConfig>(defaultUpdatesConfig); | ||
const Context = React.createContext<EXUpdatesConfig | null>(null); | ||
export const useUpdatesConfig = () => React.useContext(Context); | ||
|
||
type UpdatesConfigProviderProps = { | ||
children: React.ReactNode; | ||
initialUpdatesConfig?: EXUpdatesConfig; | ||
}; | ||
|
||
type SetUpdatesConfigContext = (config: Partial<EXUpdatesConfig>) => void; | ||
const SetConfigContext = React.createContext<SetUpdatesConfigContext>(() => {}); | ||
|
||
export const useSetUpdatesConfig = () => React.useContext(SetConfigContext); | ||
|
||
export function UpdatesConfigProvider({ children }: UpdatesConfigProviderProps) { | ||
const [updatesConfig, setUpdatesConfig] = React.useState(initialUpdatesConfig); | ||
|
||
function onSetUpdatesConfig(updates: Partial<EXUpdatesConfig>) { | ||
setUpdatesConfig((previousConfig) => { | ||
return { | ||
...previousConfig, | ||
...updates, | ||
}; | ||
}); | ||
} | ||
|
||
return ( | ||
<SetConfigContext.Provider value={onSetUpdatesConfig}> | ||
<Context.Provider value={updatesConfig}>{children}</Context.Provider> | ||
</SetConfigContext.Provider> | ||
); | ||
return <Context.Provider value={updatesConfig}>{children}</Context.Provider>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.