Fix #896 Port Send Android to choo

This commit is contained in:
Donovan Preston 2018-08-16 12:07:12 -04:00
parent 071e283f87
commit 7a48c5201a
No known key found for this signature in database
GPG key ID: B43EF44E428C806E
10 changed files with 195 additions and 206 deletions

17
android/stores/intents.js Normal file
View file

@ -0,0 +1,17 @@
/* eslint-disable no-console */
export default function intentHandler(state, emitter) {
window.addEventListener(
'message',
event => {
fetch(event.data)
.then(res => res.blob())
.then(blob => {
emitter.emit('addFiles', { files: [blob] });
emitter.emit('upload', {});
})
.catch(e => console.error('ERROR ' + e + ' ' + e.stack));
},
false
);
}