Test to fix duplicate message issue
This commit is contained in:
parent
6378f4b225
commit
dda589c2e8
@ -62,6 +62,12 @@ export class UserModel implements Subject<ActiveUserViewModel> {
|
|||||||
this.notify();
|
this.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateLastActive(username: String, lastActive: Date): void {
|
||||||
|
this._activeUsersList
|
||||||
|
.filter(u => u.userName == username)
|
||||||
|
.forEach(u => u.lastActive = lastActive)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getActiveUsers
|
* getActiveUsers
|
||||||
*/
|
*/
|
||||||
@ -106,5 +112,5 @@ export class UserModel implements Subject<ActiveUserViewModel> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private helperMethod() {}
|
private helperMethod() { }
|
||||||
}
|
}
|
||||||
|
@ -83,13 +83,13 @@ export class ChatView implements Observer<ChatMessageViewModel> {
|
|||||||
// this._userModel.notify();
|
// this._userModel.notify();
|
||||||
// }
|
// }
|
||||||
$(this._messageContainer)
|
$(this._messageContainer)
|
||||||
.stop()
|
.stop()
|
||||||
.animate(
|
.animate(
|
||||||
{
|
{
|
||||||
scrollTop: $(this._messageContainer)[0].scrollHeight,
|
scrollTop: $(this._messageContainer)[0].scrollHeight,
|
||||||
},
|
},
|
||||||
1500
|
1500
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "page":
|
case "page":
|
||||||
@ -181,6 +181,7 @@ export class ChatView implements Observer<ChatMessageViewModel> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.update({ data: new Array(context), op: "new" });
|
this.update({ data: new Array(context), op: "new" });
|
||||||
|
this._userModel.updateLastActive(contactName, msgTime)
|
||||||
this._userModel.notify();
|
this._userModel.notify();
|
||||||
|
|
||||||
let messageCipher: MessageCipherDTO = this._encryptionService.encrypt(
|
let messageCipher: MessageCipherDTO = this._encryptionService.encrypt(
|
||||||
|
Loading…
Reference in New Issue
Block a user