remove download cancel button while decrypting
This commit is contained in:
parent
dbfae53222
commit
2292267e39
|
@ -53,7 +53,7 @@ export default function(state, emitter) {
|
||||||
checkFiles();
|
checkFiles();
|
||||||
});
|
});
|
||||||
|
|
||||||
// emitter.on('navigate', checkFiles);
|
emitter.on('navigate', checkFiles);
|
||||||
|
|
||||||
emitter.on('render', () => {
|
emitter.on('render', () => {
|
||||||
lastRender = Date.now();
|
lastRender = Date.now();
|
||||||
|
|
|
@ -64,6 +64,7 @@ export default class FileReceiver extends Nanobus {
|
||||||
const ciphertext = await download.result;
|
const ciphertext = await download.result;
|
||||||
this.fileDownload = null;
|
this.fileDownload = null;
|
||||||
this.msg = 'decryptingFile';
|
this.msg = 'decryptingFile';
|
||||||
|
this.state = 'decrypting';
|
||||||
this.emit('decrypting');
|
this.emit('decrypting');
|
||||||
const plaintext = await this.keychain.decryptFile(ciphertext);
|
const plaintext = await this.keychain.decryptFile(ciphertext);
|
||||||
if (this.cancelled) {
|
if (this.cancelled) {
|
||||||
|
|
|
@ -4,30 +4,33 @@ const { bytes } = require('../utils');
|
||||||
|
|
||||||
module.exports = function(state, emit) {
|
module.exports = function(state, emit) {
|
||||||
const transfer = state.transfer;
|
const transfer = state.transfer;
|
||||||
|
const cancelBtn = html`
|
||||||
|
<button
|
||||||
|
id="cancel-upload"
|
||||||
|
title="${state.translate('deletePopupCancel')}"
|
||||||
|
onclick=${cancel}>
|
||||||
|
${state.translate('deletePopupCancel')}
|
||||||
|
</button>`;
|
||||||
|
|
||||||
const div = html`
|
const div = html`
|
||||||
<div id="page-one">
|
<div id="page-one">
|
||||||
<div id="download">
|
<div id="download">
|
||||||
<div id="download-progress" class="fadeIn">
|
<div id="download-progress" class="fadeIn">
|
||||||
<div id="dl-title" class="title">${state.translate(
|
<div id="dl-title" class="title">
|
||||||
'downloadingPageProgress',
|
${state.translate('downloadingPageProgress', {
|
||||||
{
|
|
||||||
filename: state.fileInfo.name,
|
filename: state.fileInfo.name,
|
||||||
size: bytes(state.fileInfo.size)
|
size: bytes(state.fileInfo.size)
|
||||||
}
|
})}
|
||||||
)}</div>
|
</div>
|
||||||
<div class="description">${state.translate(
|
<div class="description">
|
||||||
'downloadingPageMessage'
|
${state.translate('downloadingPageMessage')}
|
||||||
)}</div>
|
</div>
|
||||||
${progress(transfer.progressRatio)}
|
${progress(transfer.progressRatio)}
|
||||||
<div class="upload">
|
<div class="upload">
|
||||||
<div class="progress-text">${state.translate(
|
<div class="progress-text">
|
||||||
transfer.msg,
|
${state.translate(transfer.msg, transfer.sizes)}
|
||||||
transfer.sizes
|
</div>
|
||||||
)}</div>
|
${transfer.state === 'downloading' ? cancelBtn : null}
|
||||||
<button
|
|
||||||
id="cancel-upload"
|
|
||||||
title="${state.translate('deletePopupCancel')}"
|
|
||||||
onclick=${cancel}>${state.translate('deletePopupCancel')}</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -46,7 +46,7 @@ module.exports = function(state, emit) {
|
||||||
let pageAction = null; //default state: we don't have file metadata
|
let pageAction = null; //default state: we don't have file metadata
|
||||||
if (state.transfer) {
|
if (state.transfer) {
|
||||||
const s = state.transfer.state;
|
const s = state.transfer.state;
|
||||||
if (s === 'downloading' || s === 'complete') {
|
if (['downloading', 'decrypting', 'complete'].indexOf(s) > -1) {
|
||||||
// Downloading is in progress
|
// Downloading is in progress
|
||||||
return download(state, emit);
|
return download(state, emit);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue