From 062b0df241f402f3d0618e6f046eb1205a0ebf1c Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Thu, 6 Jun 2024 23:05:51 +0300 Subject: [PATCH 1/3] Fix Bug 68386 Files not opening in the New files panel on iOS --- .../src/components/panels/NewFilesPanel/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/panels/NewFilesPanel/index.js b/packages/client/src/components/panels/NewFilesPanel/index.js index 49729a5b33..3cfbe276d5 100644 --- a/packages/client/src/components/panels/NewFilesPanel/index.js +++ b/packages/client/src/components/panels/NewFilesPanel/index.js @@ -145,9 +145,11 @@ const NewFilesPanel = (props) => { const item = newFiles.find((file) => file.id.toString() === id); + const blankWindow = window.open(); + markAsRead(folderIds, fileIds, item) .then(() => { - onFileClick(item); + onFileClick(item, blankWindow); const newListFiles = listFiles.filter( (file) => file.id.toString() !== id, @@ -165,7 +167,7 @@ const NewFilesPanel = (props) => { }); }; - const onFileClick = (item) => { + const onFileClick = (item, blankWindow) => { const { id, fileExst, @@ -262,7 +264,11 @@ const NewFilesPanel = (props) => { } } - return window.open(webUrl, "_blank"); + if (openOnNewPage) { + blankWindow.location.href = webUrl; + } else { + window.open(webUrl, "_self"); + } } }; From ef116f1498a6be1a64c0e6db9e5d2c4326991335 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Fri, 7 Jun 2024 11:02:53 +0300 Subject: [PATCH 2/3] Revert "Fix Bug 68386" This reverts commit 062b0df241f402f3d0618e6f046eb1205a0ebf1c. --- .../src/components/panels/NewFilesPanel/index.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/client/src/components/panels/NewFilesPanel/index.js b/packages/client/src/components/panels/NewFilesPanel/index.js index 3cfbe276d5..49729a5b33 100644 --- a/packages/client/src/components/panels/NewFilesPanel/index.js +++ b/packages/client/src/components/panels/NewFilesPanel/index.js @@ -145,11 +145,9 @@ const NewFilesPanel = (props) => { const item = newFiles.find((file) => file.id.toString() === id); - const blankWindow = window.open(); - markAsRead(folderIds, fileIds, item) .then(() => { - onFileClick(item, blankWindow); + onFileClick(item); const newListFiles = listFiles.filter( (file) => file.id.toString() !== id, @@ -167,7 +165,7 @@ const NewFilesPanel = (props) => { }); }; - const onFileClick = (item, blankWindow) => { + const onFileClick = (item) => { const { id, fileExst, @@ -264,11 +262,7 @@ const NewFilesPanel = (props) => { } } - if (openOnNewPage) { - blankWindow.location.href = webUrl; - } else { - window.open(webUrl, "_self"); - } + return window.open(webUrl, "_blank"); } }; From 00552f2ea1a22e3c80fb557ee357f2f5953518e0 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Fri, 7 Jun 2024 11:06:04 +0300 Subject: [PATCH 3/3] Fix Bug 68386 Files not opening in the New files panel on iOS --- packages/client/src/components/panels/NewFilesPanel/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/client/src/components/panels/NewFilesPanel/index.js b/packages/client/src/components/panels/NewFilesPanel/index.js index 49729a5b33..c3b0a2d020 100644 --- a/packages/client/src/components/panels/NewFilesPanel/index.js +++ b/packages/client/src/components/panels/NewFilesPanel/index.js @@ -145,10 +145,9 @@ const NewFilesPanel = (props) => { const item = newFiles.find((file) => file.id.toString() === id); + onFileClick(item); markAsRead(folderIds, fileIds, item) .then(() => { - onFileClick(item); - const newListFiles = listFiles.filter( (file) => file.id.toString() !== id, ); @@ -262,7 +261,7 @@ const NewFilesPanel = (props) => { } } - return window.open(webUrl, "_blank"); + return window.open(webUrl, openOnNewPage ? "_blank" : "_self"); } };