Fix #896 Port Send Android to choo
This commit is contained in:
parent
071e283f87
commit
7a48c5201a
10 changed files with 195 additions and 206 deletions
17
android/stores/intents.js
Normal file
17
android/stores/intents.js
Normal 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
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue