Этот коммит содержится в:
Asaad Mahmood
2016-02-12 20:19:07 +05:00
родитель 6bf1203581 6cb4f82ee5
Коммит 7bea418a65
17 изменённых файлов: 60 добавлений и 38 удалений

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

@@ -521,18 +521,25 @@ export function getPosts(id) {
return;
}
if (PostStore.getAllPosts(channelId) == null) {
const postList = PostStore.getAllPosts(channelId);
if ($.isEmptyObject(postList) || postList.order.length < Constants.POST_CHUNK_SIZE) {
getPostsPage(channelId, Constants.POST_CHUNK_SIZE);
return;
}
const latestUpdate = PostStore.getLatestUpdate(channelId);
const latestPost = PostStore.getLatestPost(channelId);
let latestPostTime = 0;
if (latestPost != null && latestPost.update_at != null) {
latestPostTime = latestPost.create_at;
}
callTracker['getPosts_' + channelId] = utils.getTimestamp();
client.getPosts(
channelId,
latestUpdate,
latestPostTime,
(data, textStatus, xhr) => {
if (xhr.status === 304 || !data) {
return;

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

@@ -260,6 +260,10 @@ export function displayTimeFormatted(ticks) {
);
}
export function isMilitaryTime() {
return PreferenceStore.getBool(Constants.Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time');
}
export function displayDateTime(ticks) {
var seconds = Math.floor((Date.now() - ticks) / 1000);