Use async store

This commit is contained in:
yflory
2017-11-30 15:01:17 +01:00
parent 0840570fbf
commit b3688db202
15 changed files with 251 additions and 297 deletions

View File

@@ -78,18 +78,14 @@ define([
var chanId = Utils.Hash.hrefToHexChannelId(data);
Cryptpad.pinPads([chanId], function (e) {
if (e) { return void cb(e); }
Cryptpad.getProxy().profile.avatar = data;
Utils.Realtime.whenRealtimeSyncs(Cryptpad.getRealtime(), function () {
cb();
});
Cryptpad.setAvatar(data, cb);
});
});
// Removing the avatar from the profile: unpin it
sframeChan.on('Q_PROFILE_AVATAR_REMOVE', function (data, cb) {
var chanId = Utils.Hash.hrefToHexChannelId(data);
Cryptpad.unpinPads([chanId], function (e) {
delete Cryptpad.getProxy().profile.avatar;
cb(e);
Cryptpad.unpinPads([chanId], function () {
Cryptpad.setAvatar(undefined, cb);
});
});
};