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
39
android/stores/state.js
Normal file
39
android/stores/state.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
/* eslint-disable no-console */
|
||||
|
||||
export default function initialState(state, emitter) {
|
||||
const files = [];
|
||||
|
||||
Object.assign(state, {
|
||||
getAsset(name) {
|
||||
return `/android_asset/${name}`;
|
||||
},
|
||||
translate: (...toTranslate) => {
|
||||
return toTranslate.map(o => JSON.stringify(o)).toString();
|
||||
},
|
||||
raven: {
|
||||
captureException: e => {
|
||||
console.error('ERROR ' + e + ' ' + e.stack);
|
||||
}
|
||||
},
|
||||
storage: {
|
||||
files,
|
||||
remove: function(fileId) {
|
||||
console.log('REMOVE FILEID', fileId);
|
||||
},
|
||||
writeFile: function(file) {
|
||||
console.log('WRITEFILE', file);
|
||||
},
|
||||
addFile: function(file) {
|
||||
console.log('addfile' + JSON.stringify(file));
|
||||
files.push(file);
|
||||
emitter.emit('pushState', `/share/${file.id}`);
|
||||
},
|
||||
totalUploads: 0
|
||||
},
|
||||
transfer: null,
|
||||
uploading: false,
|
||||
settingPassword: false,
|
||||
passwordSetError: null,
|
||||
route: '/'
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue