mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 20:37:42 +00:00
fix bug - open parent folder url error (#6703)
This commit is contained in:
@@ -130,7 +130,12 @@ const ContextMenu = ({
|
|||||||
const { groupRecordIndex, rowIdx } = selectedPosition;
|
const { groupRecordIndex, rowIdx } = selectedPosition;
|
||||||
const record = recordGetterByIndex({ isGroupView, groupRecordIndex, recordIndex: rowIdx });
|
const record = recordGetterByIndex({ isGroupView, groupRecordIndex, recordIndex: rowIdx });
|
||||||
if (!record) return;
|
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);
|
const url = window.location.origin + window.location.pathname + Utils.encodePath(parentDir);
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
}, [isGroupView, recordGetterByIndex, selectedPosition]);
|
}, [isGroupView, recordGetterByIndex, selectedPosition]);
|
||||||
|
Reference in New Issue
Block a user