Commit 03f6112a by Kim Peace

Fixed to finish collaboration when clean up collaboration message received

parent 3ee7e398
...@@ -169,9 +169,9 @@ Common.startCollaboration = function (collaborationType) { ...@@ -169,9 +169,9 @@ Common.startCollaboration = function (collaborationType) {
Common.dismissLoadingIndicator(); Common.dismissLoadingIndicator();
return; return;
} }
const sendData = DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL;
CHAT_SOCKET.emitCreateMessage(SOCKET_KEY.CREATE_MESSAGE, sendData);
NativeBridgeDelegate.finishAllCollaboration();
} }
CHAT_SOCKET.emitCollaborationFinishMessage();
NativeBridgeDelegate.finishAllCollaboration();
NativeBridgeDelegate.startCollaboration(collaborationType); NativeBridgeDelegate.startCollaboration(collaborationType);
}; };
...@@ -19,6 +19,10 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) { ...@@ -19,6 +19,10 @@ CHAT_SOCKET.handleMessage = function (message, roomName, socketKey) {
DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL DATA_MESSAGE_SCHEME + FINISH_ALL_COLLABORATION_SIGNAL
) { ) {
CHAT_SOCKET.cleanUpCollaborationMessage(); CHAT_SOCKET.cleanUpCollaborationMessage();
if (typeof CoviewBridge !== "undefined") {
CoviewBridge.finishCollaboration();
}
return; return;
} }
...@@ -120,6 +124,7 @@ CHAT_SOCKET.renderCollaborationMessage = function ( ...@@ -120,6 +124,7 @@ CHAT_SOCKET.renderCollaborationMessage = function (
createdAtDay: messageTime.createdAtDay, createdAtDay: messageTime.createdAtDay,
createdAtTime: messageTime.createdAtTime, createdAtTime: messageTime.createdAtTime,
isOtherYear: false, isOtherYear: false,
collaborationJoinMessage: getLocalizedString("message_join"),
}); });
}; };
...@@ -176,8 +181,11 @@ CHAT_SOCKET.getUserInfoList = function (userID) { ...@@ -176,8 +181,11 @@ CHAT_SOCKET.getUserInfoList = function (userID) {
return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID)); return JSON.parse(NativeBridgeDataSource.getUserInfoList(userID));
}; };
CHAT_SOCKET.cleanUpCollaborationMessage = function () { CHAT_SOCKET.cleanUpCollaborationMessage = function (exceptFirst = false) {
$(".collabo_area.start").each(function (index, collaborationMessage) { $(".collabo_area.start").each(function (index, collaborationMessage) {
if (exceptFirst && index === 0) {
return;
}
$(collaborationMessage).removeClass("start"); $(collaborationMessage).removeClass("start");
$(collaborationMessage).addClass("end"); $(collaborationMessage).addClass("end");
$(collaborationMessage).addClass("disable"); $(collaborationMessage).addClass("disable");
......
...@@ -98,6 +98,8 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) { ...@@ -98,6 +98,8 @@ ChatRoom.loadMessages = function (joinRoomID, joinRoomName) {
let messages = NativeBridgeDataSource.getMessagesByRoomID(roomID); let messages = NativeBridgeDataSource.getMessagesByRoomID(roomID);
ChatRoom.prependMessage(messages); ChatRoom.prependMessage(messages);
CHAT_SOCKET.cleanUpCollaborationMessage(true);
window.addEventListener( window.addEventListener(
"load", "load",
function (event) { function (event) {
......
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