Unverified Commit 915d19fb authored by Diego Mello's avatar Diego Mello Committed by GitHub
Browse files

[FIX] Cancel upload and check failed upload (#1232)

parent bbc8fe53
...@@ -14,7 +14,7 @@ export async function cancelUpload(item) { ...@@ -14,7 +14,7 @@ export async function cancelUpload(item) {
uploadQueue[item.path].abort(); uploadQueue[item.path].abort();
try { try {
const db = database.active; const db = database.active;
await db.database.action(async() => { await db.action(async() => {
await item.destroyPermanently(); await item.destroyPermanently();
}); });
} catch (e) { } catch (e) {
......
...@@ -122,7 +122,8 @@ class UploadProgress extends Component { ...@@ -122,7 +122,8 @@ class UploadProgress extends Component {
uploads.forEach(async(u) => { uploads.forEach(async(u) => {
if (!RocketChat.isUploadActive(u.path)) { if (!RocketChat.isUploadActive(u.path)) {
try { try {
await database.database.action(async() => { const db = database.active;
await db.action(async() => {
await u.update(() => { await u.update(() => {
u.error = true; u.error = true;
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment