Download attachments in separate queue from message processing

This commit is contained in:
Scott Nonnenberg 2019-01-30 12:15:07 -08:00
parent a43a78731a
commit 1d2c3ae23c
34 changed files with 2062 additions and 214 deletions

View file

@ -63,7 +63,9 @@ interface Avatar {
}
interface Attachment {
path: string;
path?: string;
error?: boolean;
pending?: boolean;
}
export function contactSelector(
@ -85,14 +87,20 @@ export function contactSelector(
} = options;
let { avatar } = contact;
if (avatar && avatar.avatar && avatar.avatar.path) {
avatar = {
...avatar,
avatar: {
...avatar.avatar,
path: getAbsoluteAttachmentPath(avatar.avatar.path),
},
};
if (avatar && avatar.avatar) {
if (avatar.avatar.error) {
avatar = undefined;
} else {
avatar = {
...avatar,
avatar: {
...avatar.avatar,
path: avatar.avatar.path
? getAbsoluteAttachmentPath(avatar.avatar.path)
: undefined,
},
};
}
}
return {