[FIX] Cancel upload and check failed upload (#1232)
This commit is contained in:
parent
bbc8fe5398
commit
915d19fbe8
|
@ -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 {
|
||||||
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;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue