mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 16:10:26 +00:00
[shared file view] fixup for download url (#4026)
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext } from '../../utils/constants';
|
||||
|
||||
const { err, trafficOverLimit } = window.shared.pageOptions;
|
||||
const { err, trafficOverLimit, zipped, filePath } = window.shared.pageOptions;
|
||||
|
||||
const propTypes = {
|
||||
errorMsg: PropTypes.string
|
||||
@@ -21,7 +21,7 @@ class SharedFileViewTip extends React.Component {
|
||||
<div className="file-view-tip">
|
||||
{errorMsg}
|
||||
{!trafficOverLimit &&
|
||||
<a href="?dl=1" className="btn btn-secondary">{gettext('Download')}</a>
|
||||
<a href={`?${zipped ? 'p=' + encodeURIComponent(filePath) + '&' : ''}dl=1`} className="btn btn-secondary">{gettext('Download')}</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user