1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 12:27:48 +00:00

fix bug - open parent folder url error (#6703)

This commit is contained in:
Aries
2024-09-04 07:33:16 +08:00
committed by GitHub
parent 7a09ebd288
commit ca7dae1e62

View File

@@ -130,7 +130,12 @@ const ContextMenu = ({
const { groupRecordIndex, rowIdx } = selectedPosition;
const record = recordGetterByIndex({ isGroupView, groupRecordIndex, recordIndex: rowIdx });
if (!record) return;
const parentDir = record[PRIVATE_COLUMN_KEY.PARENT_DIR];
let parentDir = record[PRIVATE_COLUMN_KEY.PARENT_DIR];
if (window.location.pathname.endsWith('/')) {
parentDir = parentDir.slice(1);
}
const url = window.location.origin + window.location.pathname + Utils.encodePath(parentDir);
window.open(url, '_blank');
}, [isGroupView, recordGetterByIndex, selectedPosition]);