Skip to content

Commit

Permalink
Merge pull request #340 from ONLYOFFICE/bugfix/open-media-history-ver…
Browse files Browse the repository at this point in the history
…sion

Bugfix/open media history version
  • Loading branch information
AlexeySafronov authored Sep 20, 2021
2 parents 021ab20 + c8d55d4 commit 90a9575
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion products/ASC.Files/Client/src/Files.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const SETTINGS_URL = combineUrl(PROXY_HOMEPAGE_URL, "/settings/:setting");
const HISTORY_URL = combineUrl(PROXY_HOMEPAGE_URL, "/:fileId/history");
const PRIVATE_ROOMS_URL = combineUrl(PROXY_HOMEPAGE_URL, "/private");
const FILTER_URL = combineUrl(PROXY_HOMEPAGE_URL, "/filter");
const MEDIA_VIEW_URL = combineUrl(PROXY_HOMEPAGE_URL, "/view");
const MEDIA_VIEW_URL = combineUrl(PROXY_HOMEPAGE_URL, "/#preview");

if (!window.AppServer) {
window.AppServer = {};
Expand Down
6 changes: 3 additions & 3 deletions products/ASC.Files/Client/src/pages/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ class PureHome extends React.Component {
const match = window.location.pathname.match(reg);
let filterObj = null;

if (window.location.pathname.indexOf("/files/view") > 1) {
const pathname = window.location.pathname;
const fileId = pathname.slice(pathname.indexOf("view") + 5);
if (window.location.href.indexOf("/files/#preview") > 1) {
const pathname = window.location.href;
const fileId = pathname.slice(pathname.indexOf("#preview") + 9);

getFileInfo(fileId)
.then((data) => {
Expand Down
6 changes: 5 additions & 1 deletion products/ASC.Files/Client/src/store/FilesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,11 @@ class FilesStore {
);

const previewUrl = canOpenPlayer
? combineUrl(AppServerConfig.proxyURL, config.homepage, `/view/${id}`)
? combineUrl(
AppServerConfig.proxyURL,
config.homepage,
`/#preview/${id}`
)
: null;
const contextOptions = this.getFilesContextOptions(item, canOpenPlayer);

Expand Down

0 comments on commit 90a9575

Please sign in to comment.