Make proper async calls when switching channels

Этот коммит содержится в:
JoramWilander
2015-12-02 10:22:39 -05:00
родитель b8a1894b00
Коммит 14804965b5
4 изменённых файлов: 76 добавлений и 61 удалений

Просмотреть файл

@@ -106,10 +106,16 @@ export function getChannel(id) {
);
}
export function updateLastViewedAt() {
const channelId = ChannelStore.getCurrentId();
export function updateLastViewedAt(id) {
let channelId;
if (id) {
channelId = id;
} else {
channelId = ChannelStore.getCurrentId();
}
console.log('start ' + channelId);
if (channelId === null) {
if (channelId == null) {
return;
}
@@ -118,6 +124,7 @@ export function updateLastViewedAt() {
}
callTracker[`updateLastViewed${channelId}`] = utils.getTimestamp();
console.log('call ' + channelId);
client.updateLastViewedAt(
channelId,
() => {
@@ -159,8 +166,13 @@ export function getMoreChannels(force) {
}
}
export function getChannelExtraInfo() {
const channelId = ChannelStore.getCurrentId();
export function getChannelExtraInfo(id) {
let channelId;
if (id) {
channelId = id;
} else {
channelId = ChannelStore.getCurrentId();
}
if (channelId != null) {
if (isCallInProgress('getChannelExtraInfo_' + channelId)) {