handle reports for files that have been already been deleted
This commit is contained in:
parent
06daba9ce0
commit
d023a53b74
|
@ -232,9 +232,7 @@ export default function(state, emitter) {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.message === '401' || e.message === '404') {
|
if (e.message === '401' || e.message === '404') {
|
||||||
file.password = null;
|
file.password = null;
|
||||||
if (!file.requiresPassword) {
|
file.dead = e.message === '404';
|
||||||
return emitter.emit('pushState', '/404');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
return emitter.emit('pushState', '/error');
|
return emitter.emit('pushState', '/error');
|
||||||
|
@ -320,7 +318,8 @@ export default function(state, emitter) {
|
||||||
|
|
||||||
emitter.on('report', async ({ reason }) => {
|
emitter.on('report', async ({ reason }) => {
|
||||||
try {
|
try {
|
||||||
await state.transfer.reportLink(reason);
|
const receiver = state.transfer || new FileReceiver(state.fileInfo);
|
||||||
|
await receiver.reportLink(reason);
|
||||||
render();
|
render();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|
|
@ -90,6 +90,10 @@ module.exports = function(state, emit) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state.fileInfo.dead) {
|
||||||
|
return notFound(state);
|
||||||
|
}
|
||||||
|
|
||||||
if (!state.transfer && !state.fileInfo.requiresPassword) {
|
if (!state.transfer && !state.fileInfo.requiresPassword) {
|
||||||
emit('getMetadata');
|
emit('getMetadata');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue