[MM-47970] + [MM-47754] Downloads fixes (#2326)

* Use downloads location as default when clicking "Save as". Remove update from downloads after upgrade when application starts

* Fix issue where "addedAt" was extracted from undefined object

* Fix tests
This commit is contained in:
Tasos Boulis
2022-10-27 20:00:28 +03:00
committed by GitHub
parent a29528f1fd
commit ca62814ce6
6 changed files with 50 additions and 42 deletions

View File

@@ -15,7 +15,7 @@ type OwnProps = {
const FileSizeAndStatus = ({item}: OwnProps) => {
const translate = useIntl();
const {totalBytes, receivedBytes, addedAt} = item;
const {totalBytes, receivedBytes, addedAt} = item || {};
const getRemainingTime = useCallback(() => {
const elapsedMs = Date.now() - addedAt;