Skip to content

Commit 9d43050

Browse files
committed
Improve the layer handling
1 parent 16e4ad9 commit 9d43050

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/react-native-contentpass-ui/src/components/ContentpassLayer.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const MESSAGE_PROTOCOL = 'contentpass-first-layer';
99
const buildGlueCodeJs = (firstLayerUrl: string) => `
1010
(function () {
1111
try {
12-
if (window.location.href === 'about:blank') {
12+
if (!window.location.href || window.location.href === 'about:blank') {
1313
var encodedUrl = '${encodeURIComponent(firstLayerUrl)}';
1414
var decodedUrl = decodeURIComponent(encodedUrl);
1515
window.location.href = decodedUrl;
@@ -35,11 +35,11 @@ const buildGlueCodeJs = (firstLayerUrl: string) => `
3535
const styles = StyleSheet.create({
3636
container: {
3737
flex: 1,
38-
backgroundColor: 'white',
38+
backgroundColor: 'transparent',
3939
},
4040
webview: {
4141
flex: 1,
42-
backgroundColor: 'red',
42+
backgroundColor: 'transparent',
4343
},
4444
error: {
4545
flex: 1,
@@ -153,7 +153,7 @@ export default function ContentpassLayer({
153153
return (
154154
<View style={styles.container}>
155155
<WebView
156-
source={{ uri: 'about:blank' }}
156+
source={{ html: '' }}
157157
style={styles.webview}
158158
originWhitelist={['*']}
159159
startInLoadingState

0 commit comments

Comments
 (0)