Commit 49aed2c0 by Kim Peace

Merge branch 'feature/start_collaboration_when_other_exist' into 'develop'

Fixed to finish collaboration when clean up collaboration message received

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