Skip to content

Commit 61a2dea

Browse files
committed
fix: Disable DataProxy's iframe when running inside of Flagship app
When running inside of Flagship app, we don't want to load the DataProxy's iframe Instead we want to use the Flagship app's API For now this API does not exist, so we just disable the DataProxy feature We could have enabled the iframe until the native API is implemented, but for now this would introduce an infinite nested iframes bug as the Flagship app's WebViews intercept all requests to `/` or `/index.html` and inject the cozy-home code
1 parent c4c4674 commit 61a2dea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dataproxy/DataProxyProvider.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as Comlink from 'comlink'
22
import React, { useContext, useState, useEffect } from 'react'
33

44
import { useClient } from 'cozy-client'
5+
import { isFlagshipApp } from 'cozy-device-helper'
56
import flag from 'cozy-flags'
67
import Minilog from 'cozy-minilog'
78

@@ -66,7 +67,11 @@ export const DataProxyProvider = React.memo(({ children }) => {
6667
}
6768
}
6869

69-
initIframe()
70+
if (isFlagshipApp()) {
71+
setDataProxyServicesAvailable(false)
72+
} else {
73+
initIframe()
74+
}
7075
}, [client])
7176

7277
const onIframeLoaded = () => {

0 commit comments

Comments
 (0)