integrate with new ui

This commit is contained in:
Emily 2018-08-08 11:07:09 -07:00
parent 13057804ab
commit bf16e5c8a9
27 changed files with 250 additions and 315 deletions

View file

@ -1,4 +1,5 @@
/* global MAXFILESIZE */
/* global DEFAULT_EXPIRE_SECONDS */
import FileSender from './fileSender';
import FileReceiver from './fileReceiver';
import { copyToClipboard, delay, openLinksInNewTab, percent } from './utils';
@ -110,7 +111,9 @@ export default function(state, emitter) {
emitter.on('upload', async ({ type, dlCount, password }) => {
if (!state.archive) return;
const size = state.archive.size;
const sender = new FileSender(state.archive);
if (!state.timeLimit) state.timeLimit = DEFAULT_EXPIRE_SECONDS;
const sender = new FileSender(state.archive, state.timeLimit);
sender.on('progress', updateProgress);
sender.on('encrypting', render);
sender.on('complete', render);
@ -157,7 +160,7 @@ export default function(state, emitter) {
}
} finally {
openLinksInNewTab(links, false);
state.files = [];
state.archive = null;
state.password = '';
state.uploading = false;
state.transfer = null;