mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Add webview background defaults to device color mode
This commit is contained in:
parent
3e2b48862f
commit
6ecf6b105d
@ -12,13 +12,13 @@ const backgroundColors = {
|
||||
};
|
||||
|
||||
const App = () => {
|
||||
const colorScheme = Appearance.getColorScheme();
|
||||
const colorScheme = Appearance.getColorScheme() ?? 'light';
|
||||
const torClient = new TorClient();
|
||||
const webViewRef = useRef<WebView>();
|
||||
const uri = (Platform.OS === 'android' ? 'file:///android_asset/' : '') + 'Web.bundle/index.html';
|
||||
|
||||
const injectMessageResolve = (id: string, data?: object) => {
|
||||
const json = JSON.stringify((data != null) || {});
|
||||
const json = JSON.stringify(data != null || {});
|
||||
webViewRef.current?.injectJavaScript(
|
||||
`(function() {window.NativeRobosats.onMessageResolve(${id}, ${json});})();`,
|
||||
);
|
||||
@ -145,6 +145,7 @@ const App = () => {
|
||||
}}
|
||||
onMessage={onMessage}
|
||||
// @ts-expect-error
|
||||
style={{ backgroundColor: backgroundColors[colorScheme] }}
|
||||
ref={(ref) => (webViewRef.current = ref)}
|
||||
overScrollMode='never'
|
||||
javaScriptEnabled={true}
|
||||
|
Loading…
Reference in New Issue
Block a user