Skip to content

Commit 7ed00a3

Browse files
paultranvanLdoppea
authored andcommitted
refactor: Links should be array
1 parent c12c78a commit 7ed00a3

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/components/AppWrapper.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ export const setupAppContext = memoize(intent => {
4343
const root = document.querySelector('[role=application]')
4444
const data = root.dataset
4545

46-
const shouldUseWebFlagshipLink = isFlagshipApp() && isFlagshipOfflineSupported()
46+
const shouldUseWebFlagshipLink =
47+
isFlagshipApp() && isFlagshipOfflineSupported()
48+
49+
const links = shouldUseWebFlagshipLink
50+
? [new WebFlagshipLink({ webviewIntent: intent })]
51+
: null
4752

4853
// New improvements must be done with CozyClient
4954
const cozyClient = new CozyClient({
@@ -56,9 +61,7 @@ export const setupAppContext = memoize(intent => {
5661
)
5762
? true
5863
: false,
59-
links: shouldUseWebFlagshipLink
60-
? new WebFlagshipLink({ webviewIntent: intent })
61-
: null
64+
links
6265
})
6366

6467
cozyClient.registerPlugin(flag.plugin)

0 commit comments

Comments
 (0)