Merge pull request #4163 from matrix-org/t3chguy/double_download
only automatically download in usercontent if user requested itpull/21833/head
commit
b23eaa1ce7
|
@ -271,6 +271,8 @@ export default createReactClass({
|
||||||
// We can't provide a Content-Disposition header like we would for HTTP.
|
// We can't provide a Content-Disposition header like we would for HTTP.
|
||||||
download: fileName,
|
download: fileName,
|
||||||
textContent: _t("Download %(text)s", { text: text }),
|
textContent: _t("Download %(text)s", { text: text }),
|
||||||
|
// only auto-download if a user triggered this iframe explicitly
|
||||||
|
auto: !this.props.decryptedBlob,
|
||||||
}, "*");
|
}, "*");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,10 @@ function remoteRender(event) {
|
||||||
// Don't display scrollbars if the link takes more than one line to display.
|
// Don't display scrollbars if the link takes more than one line to display.
|
||||||
body.style = "margin: 0px; overflow: hidden";
|
body.style = "margin: 0px; overflow: hidden";
|
||||||
body.appendChild(a);
|
body.appendChild(a);
|
||||||
a.click(); // try to trigger download automatically
|
|
||||||
|
if (event.data.auto) {
|
||||||
|
a.click(); // try to trigger download automatically
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remoteSetTint(event) {
|
function remoteSetTint(event) {
|
||||||
|
|
Loading…
Reference in New Issue