-
Notifications
You must be signed in to change notification settings - Fork 91
Closing chat/pm windows then re-opening #12
Comments
hi, i have same problem. any suggestions? thanks |
you have to edit this DemoClientAdapter.prototype.onMessagesChanged function. What I did was to also pass the "otherUserId" and have messagesChangedHandlers[otherUserId] = handler, this way, messagesChangedHandlers doesnt grow any longer than its needs to. the handler just gets updated every time a new pm window is opened |
Hello onsetrese, I have the same problem, and the demo on the website too. Can you post the new code with the adjustment that you did. Thanks! |
Can please someone tell me how to do what onsetrese suggested? I'm not being able to put another parameter on the handler like he said. |
File: jquery.chatjs.adapter.demo.js File: jquery.chatjs.messageboard.js Hope this helps |
Hello, First of all, thanks for the help! I managed to achieve this a few hours ago, but this won't help me, because my IDs are very random. Example: "2, 60, 150, 8590". If I do like you propose, the array gets too big. I need to find another way... Every window register the same events, over and over and over... It should unregister on the event "onClose", but I still don't know how to do it yet. |
I think I found a better solution, and more performatic to the client side (Maybe the author could incorporate this to the project) I created an event that unregister the handlers. Check out: *** At the adapter JS FILE: function SignalRClientAdapter(chatHubClient) { // adds a handler to the messagesChanged event // Ao fechar a janela de Private Message, recebe uma notificação para remover todos os handlers desta PM. *** At chatjs.controller.js: chatPmOptions.onClose = function () { |
hi @rpaschoal |
Hello @Watoo, I will share as soon as I get at home! Cheers! |
Excellent solution @rpaschoal, its simple, but works, the project isnt updating since a year Muchas Gracias por tu aporte |
@eniebla you are welcome! I am glad this helped you out! This is major bug in current project, author should change that ASAP! The plugin is awesome, should be more popular. Cheers! |
Hi @rpaschoal , there is the same error, but its now in I tell you later how it's going, sorry for my english i'm learning and i'm new in development |
I forget to tell you If you open a third one, the messages get double send, and the second one don't receive the removeTypingSignal |
I think i find the final solution for this bug, it's simple. I mix @rpaschoal and @onsetrese ideas, jejeje SECOND:---> THIRD AND FINALLY:----> Hope this helps, the author really should change that ASAP! |
Thank you for your response! I actually changed this in my project as well.... I have a "bug fixed" typescript project up and running! @andrerpena, are you alive? Cheers! |
When you open then close a chatbox then reopen the same window( userClicked function ), and type in the textbox and press send, the messages get double send. the client adapter onMessagesChanged function/listener gets called in as many times as you close open the private chat box with the same user. I hope you understand what Im saying :)
The text was updated successfully, but these errors were encountered: