Commit cb5d0bbf by Kim Peace

Fixed for chat performance tunning

parent 2824234e
......@@ -51,7 +51,11 @@ CHAT_DB.getMessages = function (roomId) {
CHAT_DB.getMessagesWithMessageId = function (messageId) {
if (CHAT_UTIL.isIOS()) {
//TODO メッセージ追加呼出。
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getMessageListFromMessageId, {
messageId: messageId
})
);
} else if (CHAT_UTIL.isAndroid()) {
return JSON.parse(android.getMessageListFromMessageId(messageId));
}
......@@ -270,8 +274,8 @@ CHAT_DB.searchMessages = function (keyword, userList) {
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.searchMessages, {
"keyWord": keyword,
"userList": userList,
keyWord: keyword,
userList: userList,
})
);
} else if (CHAT_UTIL.isAndroid()) {
......@@ -291,7 +295,9 @@ CHAT_DB.getMyGroupUsersNotInRoom = function () {
};
CHAT_DB.getUserInfo = function (shopMemberId) {
if (shopMemberId == "") { return; }
if (shopMemberId == "") {
return;
}
if (CHAT_UTIL.isIOS()) {
return JSON.parse(
callNativeApp(NATIVE_KEY_IOS.getUserInfo, { shopMemberId: shopMemberId })
......
var lastscrollvalue;
window.onscroll = function () {
beforeScroll = window.scrollY;
var beforeHeight = $(".room_container").height();
const beforeHeight = $(".room_container").height();
messageCount = $(".chat_message").length;
if ($(this).scrollTop() === 0 && messageCount >= PagingSize.MESSAGE) {
if (!$("#chatLoader").is(":visible")) {
......@@ -9,14 +9,15 @@ window.onscroll = function () {
'<div id="chatLoader" class="text-center"><div class="spinner-grow spinner-grow-sm" role="status" /></div>'
);
$("#messages").prepend(loader);
var messageId = $($(".chat_message").get(0)).data("messageid");
var messages;
const messageId = $($(".chat_message").get(0)).data("messageid");
let messages;
if (typeof android != "undefined") {
if (IS_ONLINE == "true") {
android.updatePreMessage(messageId);
}
} else {
//TODO 追加メッセージUpdate、get
// 追加メッセージUpdate、get
webkit.messageHandlers.updatePreMessage.postMessage({ messageId: messageId });
}
messages = CHAT_DB.getMessagesWithMessageId(messageId);
CHAT_UI.prependMessage(messages);
......
......@@ -1407,7 +1407,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
$("#parentGroupArea").removeClass("none");
}
//該当グループのパースを表示。
var groupPathTemplate = getTemplate(TemplateURL.GROUP_PATH);
const groupPathTemplate = getTemplate(TemplateURL.GROUP_PATH);
result.groupPathList.forEach(function (groupPath) {
let html = Mustache.render(groupPathTemplate, {
name: groupPath.groupName,
......@@ -1418,7 +1418,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
});
//該当グループの下位グループ表示。
var groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
const groupTemplate = getTemplate(TemplateURL.GROUP_LIST);
result.childGroupList.forEach(function (childGroup) {
let html = Mustache.render(groupTemplate, {
name: childGroup.groupName,
......@@ -1431,7 +1431,7 @@ CHAT_UI.refreshAllGroupSearch = function (paramGroupId) {
});
//該当グループの所属ユーザを表示。
var userTemplate = getTemplate(TemplateURL.USER_LIST);
const userTemplate = getTemplate(TemplateURL.USER_LIST);
result.groupUserList.forEach(function (groupUser) {
groupUser.profileUrl = CHAT.getProfileImgUrl(groupUser.profileUrl);
......@@ -1639,7 +1639,7 @@ CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
CHAT_UI.refreshArchiveDetailScreen = function (archiveId) {
// loadingIndicatorを表示
CHAT_UI.showLoadingIndicator();
// 初期化
$("#archiveDetail").html("");
......
......@@ -152,4 +152,6 @@ const NATIVE_KEY_IOS = {
getMyGroupUsersNotInRoom: "getMyGroupUsersNotInRoom",
getUserInfo: "getUserInfo",
getUserListByLoginId: "getUserListByLoginId",
getMessageListFromMessageId: "getMessageListFromMessageId",
updatePreMessage: "updatePreMessage",
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment