From cb41a79b36b5b54ba88533b0aa2ee3c6f9207de3 Mon Sep 17 00:00:00 2001 From: Pierre Donias Date: Wed, 5 Feb 2020 10:51:07 +0100 Subject: [PATCH] fix(xo-web): use window.open instead of window.location (#4782) Fixes #4709 Changing the location closes the WebSocket connection. --- packages/xo-web/src/common/xo/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/xo-web/src/common/xo/index.js b/packages/xo-web/src/common/xo/index.js index a72b03e5e..7af7650ad 100644 --- a/packages/xo-web/src/common/xo/index.js +++ b/packages/xo-web/src/common/xo/index.js @@ -523,7 +523,7 @@ export const importConfig = config => export const exportConfig = () => _call('xo.exportConfig').then(({ $getFrom: url }) => { - window.location = `.${url}` + window.open(`.${url}`) }) // Server ------------------------------------------------------------ @@ -1568,7 +1568,7 @@ export const exportVm = vm => info(_('startVmExport'), id) return _call('vm.export', { vm: id, compress }).then( ({ $getFrom: url }) => { - window.location = `.${url}` + window.open(`.${url}`) } ) }) @@ -1577,7 +1577,7 @@ export const exportVdi = vdi => { info(_('startVdiExport'), vdi.id) return _call('disk.exportContent', { id: resolveId(vdi) }).then( ({ $getFrom: url }) => { - window.location = `.${url}` + window.open(`.${url}`) } ) } @@ -2361,7 +2361,7 @@ export const fetchFiles = (remote, disk, partition, paths, format) => 'backup.fetchFiles', resolveIds({ remote, disk, partition, paths, format }) ).then(({ $getFrom: url }) => { - window.location = `.${url}` + window.open(`.${url}`) }) // File restore NG ---------------------------------------------------- @@ -2377,7 +2377,7 @@ export const fetchFilesNg = (remote, disk, partition, paths) => 'backupNg.fetchFiles', resolveIds({ remote, disk, partition, paths }) ).then(({ $getFrom: url }) => { - window.location = `.${url}` + window.open(`.${url}`) }) // -------------------------------------------------------------------