Fix hanging /connect notification issue (#1174)
* Adjust channel opened check to mitigate race conditions maybe * Add fix to jump user straight to apporpriate unopened channel
This commit is contained in:
parent
915e2d77b6
commit
b34ee48c1f
2 changed files with 2 additions and 1 deletions
|
|
@ -113,6 +113,7 @@ export default function getUnopenedChannels(user, successCb) {
|
|||
if (json.length > 0) {
|
||||
number.classList.add("showing")
|
||||
number.innerHTML = json.length
|
||||
document.getElementById("connect-link").href = `/connect/${json[0].adjusted_slug}` // Jump the user directly to the channel where appropriate
|
||||
} else {
|
||||
number.classList.remove("showing")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class Message < ApplicationRecord
|
|||
def update_all_has_unopened_messages_statuses
|
||||
chat_channel.
|
||||
chat_channel_memberships.
|
||||
where("last_opened_at < ?", 4.seconds.ago).
|
||||
where("last_opened_at < ?", 10.seconds.ago).
|
||||
where.
|
||||
not(user_id: user_id).
|
||||
update_all(has_unopened_messages: true)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue