Save contact photos inline, and load cards so avatars show
Stalwart refuses a blobId in a card's media ("blobIds in media is not
supported"), so adding or changing a photo always failed. The editor now
saves the photo as a data: URI, which Stalwart accepts and returns
unchanged, and leaves the card's other media as it was. Checked live on
0.16.22; the mock now refuses a blobId the same way.
Avatars in the mail list come from the address book's cards, and nothing
loaded those at sign-in, so a photo showed only after Contacts had been
opened. The cards now load in the background at start, the avatar uses
whatever cards are held, and a shared card's photo is fetched from the
account it belongs to.
Fixes #376.
This commit is contained in:
@@ -277,6 +277,13 @@ export const useContacts = create<ContactsState>((set, get) => ({
|
||||
if (!available) return;
|
||||
await get().loadBooks();
|
||||
void get().loadShared();
|
||||
/*
|
||||
* The cards too, in the background. The avatars in the mail list come from
|
||||
* them, and nothing else loaded them until Contacts was opened or an
|
||||
* address was typed -- so a photo appeared once somebody did either, and
|
||||
* was gone again after the next reload (#376).
|
||||
*/
|
||||
if (!get().loaded) void get().loadAll();
|
||||
},
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user