mirror of
https://github.com/zulip/zulip.git
synced 2026-06-30 21:11:04 +08:00
This commit resolves an issue where the edit button was not visible during message hover for new messages. The problem occurred when a message was sent after the hover event, resulting in the hovered message being a local copy with the `locally_echoed` attribute set to true. This caused the `is_message_editable_ignoring_permissions` function to return false, subsequently causing `is_content_editable` to return false as well. As a result, the `is_content_editable` argument was false, leading to the edit button not being displayed. The issue was caused due `$current_message_hover` being set to the locally echoed version of `$message_row`. When the message was successfully sent and the message was rerendered, the `message_hover` function was called again on the properly sent message row. However, the conditional check `($current_message_hover && rows.id($current_message_hover) === id)` returned true because `$current_message_hover`, set to the locally echoed version, had the same ID as the actual `$message_row`. Consequently, this condition returned true at the start of the `message_hover` function, preventing further execution of message_hover function and, consequently, the updating of hover buttons. To address this, an `else if` condition was introduced to check if the message is locally echoed. If true, the function is terminated to prevent `$current_message_hover` from being set to the locally echoed version of `$message_row` until the message is sent correctly. Once the message is sent correctly, the `message_hover` function is executed again, setting `$current_message_row` to the properly sent version of `$message_row`, and resulting in updating of hover buttons. Fixes #25312 |
||
|---|---|---|
| .. | ||
| e2e-tests | ||
| generated | ||
| html | ||
| images | ||
| shared | ||
| src | ||
| styles | ||
| templates | ||
| tests | ||
| third | ||
| .browserslistrc | ||
| .gitignore | ||
| babel.config.js | ||
| debug-require-webpack-plugin.ts | ||
| debug-require.js | ||
| postcss.config.js | ||
| webpack.assets.json | ||
| webpack.config.ts | ||
| webpack.dev-assets.json | ||