2017-08-24 23:54:02 +02:00
|
|
|
const preview = require('../templates/preview');
|
|
|
|
const download = require('../templates/download');
|
|
|
|
|
|
|
|
module.exports = function(state, emit) {
|
|
|
|
if (state.transfer) {
|
2017-08-31 18:43:36 +02:00
|
|
|
const s = state.transfer.state;
|
|
|
|
if (s === 'downloading' || s === 'complete') {
|
|
|
|
return download(state, emit);
|
|
|
|
}
|
2017-08-24 23:54:02 +02:00
|
|
|
}
|
|
|
|
return preview(state, emit);
|
|
|
|
};
|