import { FileViewerAction } from '~/views-components/context-menu/actions/file-viewer-action';
import { getNodeValue } from "~/models/tree";
import { ContextMenuKind } from '~/views-components/context-menu/context-menu';
+import { getInlineFileUrl, sanitizeToken } from "./helpers";
const mapStateToProps = (state: RootState) => {
const { resource } = state.contextMenu;
resource.menuKind === ContextMenuKind.READONLY_COLLECTION_FILES_ITEM)) {
const file = getNodeValue(resource.uuid)(state.collectionPanelFiles);
if (file) {
+ const fileUrl = sanitizeToken(getInlineFileUrl(
+ file.url,
+ state.auth.config.keepWebServiceUrl,
+ state.auth.config.keepWebInlineServiceUrl), true);
return {
- href: file.url.replace(state.auth.config.keepWebServiceUrl, state.auth.config.keepWebInlineServiceUrl),
+ href: fileUrl,
kind: 'file',
currentCollectionUuid
};