1
0
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:
llj
2019-08-28 11:23:15 +08:00
committed by Daniel Pan
parent 7aa426935f
commit c487805b59

View File

@@ -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>