mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 22:20:55 +03:00
Fix #896 Port Send Android to choo
This commit is contained in:
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
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user