Web: Client: corrected getting the URL to view media

This commit is contained in:
Dmitry Sychugov 2024-01-24 14:10:42 +05:00
parent 429044ea05
commit 2b32cec11a
4 changed files with 7 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import queryString from "query-string";
import MediaViewer from "@docspace/common/components/MediaViewer";
import { PluginFileType } from "SRC_DIR/helpers/plugins/constants";
import { MEDIA_VIEW_URL } from "@docspace/shared/constants";
import { combineUrl } from "@docspace/shared/utils/combineUrl";
const FilesMediaViewer = (props) => {
const {
@ -107,7 +108,8 @@ const FilesMediaViewer = (props) => {
};
const onChangeUrl = (id) => {
const url = MEDIA_VIEW_URL + id;
const url = combineUrl(MEDIA_VIEW_URL, id);
setCurrentId(id);
navigate(url);
};

View File

@ -2201,7 +2201,7 @@ class FilesActionStore {
);
setMediaViewerData({ visible: true, id });
const url = MEDIA_VIEW_URL + id;
const url = combineUrl(MEDIA_VIEW_URL, id);
if (this.publicRoomStore.isPublicRoom) return;

View File

@ -2952,7 +2952,7 @@ class FilesStore {
const url = getCategoryUrl(this.categoryType, id);
if (canOpenPlayer) {
return combineUrl(proxyURL, config.homepage, `${url}/${id}`);
return combineUrl(proxyURL, config.homepage, url, id);
}
if (isFolder) {

View File

@ -6,6 +6,7 @@ import {
} from "@docspace/common/components/MediaViewer/helpers";
import { thumbnailStatuses } from "SRC_DIR/helpers/filesConstants";
import { MEDIA_VIEW_URL } from "@docspace/shared/constants";
import { combineUrl } from "@docspace/shared/utils/combineUrl";
const FirstUrlKey = "isFirstUrl";
@ -77,7 +78,7 @@ class MediaViewerDataStore {
changeUrl = (id) => {
if (this.publicRoomStore.isPublicRoom) return;
const url = MEDIA_VIEW_URL + id;
const url = combineUrl(MEDIA_VIEW_URL, id);
window.DocSpace.navigate(url);
};