Skip to content

Commit

Permalink
fix: Redirect with PopupOpener on flagship app
Browse files Browse the repository at this point in the history
Flagship app does not handle a redirection with const newWindow =
window.open('') and then newWindow.location.href. So let's set the
url directly in window.open because we do not know why it was
separated in two.
  • Loading branch information
zatteo committed Sep 26, 2024
1 parent 0fe4b1a commit 3fca131
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions react/PopupOpener/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ export function openCenteredPopup(url, title, w, h) {
var left = width / 2 - w / 2 + window.screenX
var top = height / 2 - h / 2 + window.screenY
var newWindow = window.open(
'',
url,
title,
`scrollbars=yes, width=${w}, height=${h}, top=${top}, left=${left}`
)
newWindow.location.href = url

// Puts focus on the newWindow
if (window.focus) {
Expand Down

0 comments on commit 3fca131

Please sign in to comment.