Fix #890 Fix delete by initializing the metrics on android; delete was trying to use metrics and causing an exception because it hadn't been initialized
This commit is contained in:
parent
793dfb4f42
commit
c71ef9ae84
|
@ -24,6 +24,7 @@ import html from 'choo/html';
|
||||||
import Raven from 'raven-js';
|
import Raven from 'raven-js';
|
||||||
|
|
||||||
import { setApiUrlPrefix } from '../app/api';
|
import { setApiUrlPrefix } from '../app/api';
|
||||||
|
import metrics from '../app/metrics';
|
||||||
import assets from '../common/assets';
|
import assets from '../common/assets';
|
||||||
import Header from '../app/ui/header';
|
import Header from '../app/ui/header';
|
||||||
import storage from '../app/storage';
|
import storage from '../app/storage';
|
||||||
|
@ -43,6 +44,7 @@ if (navigator.userAgent === 'Send Android') {
|
||||||
|
|
||||||
const app = choo();
|
const app = choo();
|
||||||
//app.use(state);
|
//app.use(state);
|
||||||
|
app.use(metrics);
|
||||||
app.use(controller);
|
app.use(controller);
|
||||||
app.use(intents);
|
app.use(intents);
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,7 @@ export default function(state, emitter) {
|
||||||
});
|
});
|
||||||
|
|
||||||
emitter.on('delete', async ({ file, location }) => {
|
emitter.on('delete', async ({ file, location }) => {
|
||||||
|
console.log('ondelete');
|
||||||
try {
|
try {
|
||||||
metrics.deletedUpload({
|
metrics.deletedUpload({
|
||||||
size: file.size,
|
size: file.size,
|
||||||
|
@ -86,6 +87,7 @@ export default function(state, emitter) {
|
||||||
state.storage.remove(file.id);
|
state.storage.remove(file.id);
|
||||||
await file.del();
|
await file.del();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
console.log(e.stack);
|
||||||
state.raven.captureException(e);
|
state.raven.captureException(e);
|
||||||
}
|
}
|
||||||
render();
|
render();
|
||||||
|
|
Loading…
Reference in New Issue