From c99313d0ae1096ef13c3103d99dbd4b027880494 Mon Sep 17 00:00:00 2001 From: AlexeySafronov Date: Wed, 6 Oct 2021 20:53:40 +0300 Subject: [PATCH] Web: Added homepage and combineUrl to checkProtocol --- .../ASC.Files/Client/src/helpers/files-helpers.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/products/ASC.Files/Client/src/helpers/files-helpers.js b/products/ASC.Files/Client/src/helpers/files-helpers.js index be55ac8069..c9beb589b0 100644 --- a/products/ASC.Files/Client/src/helpers/files-helpers.js +++ b/products/ASC.Files/Client/src/helpers/files-helpers.js @@ -1,5 +1,7 @@ import { runInAction } from "mobx"; import { EDITOR_PROTOCOL } from "./constants"; +import { combineUrl } from "@appserver/common/utils"; +import { homepage } from "../../package.json"; export const presentInArray = (array, search, caseInsensitive = false) => { let pattern = caseInsensitive ? search.toLowerCase() : search; @@ -156,13 +158,20 @@ export const checkProtocol = (fileId, withRedirect) => reject(); window.removeEventListener("blur", onBlur); withRedirect && - window.open(`/products/files/private?fileId=${fileId}`, "_blank"); + window.open( + combineUrl("", homepage, `private?fileId=${fileId}`), + "_blank" + ); }, 1000); window.addEventListener("blur", onBlur); window.open( - `${EDITOR_PROTOCOL}:${window.location.origin}/products/files/doceditor?fileId=${fileId}`, + combineUrl( + `${EDITOR_PROTOCOL}:${window.location.origin}`, + homepage, + `doceditor?fileId=${fileId}` + ), "_self" ); });