feat(ui-flow): emit mark-channel-read-cleared for desktop unread dismiss
Resolves parent channel id for threads before notifying desktop UI. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -48,7 +48,7 @@ Returns `false` for unknown types (caller may log).
|
||||
| Boosts / stickers | `contribute-guild-boost`, `upsert-guild-sticker`, `upsert-sticker-pack` |
|
||||
| Profile | `update-profile-cosmetics`, `set-profile-banner-image`, step-up PIN types |
|
||||
| Voice / screen | `join-voice`, `join-voice-listen`, `join-stage`, `voice-capture-chunk`, `display-capture-frame` |
|
||||
| Notifications | `mark-all-notifications-read` (emits `mark-all-notifications-read-cleared`, v0.8.283), `mark-notification-read` (emits `mark-notification-read-cleared`, v0.8.282), `refresh-notifications` (v0.8.236) |
|
||||
| Notifications | `mark-all-notifications-read` (emits `mark-all-notifications-read-cleared`, v0.8.283), `mark-notification-read` (emits `mark-notification-read-cleared`, v0.8.282), `mark-channel-read` (emits `mark-channel-read-cleared`, v0.8.284), `refresh-notifications` (v0.8.236) |
|
||||
| Workers | `export-integration-worker-script`, `run-worker-install-trial`, `announce-worker-release` |
|
||||
| Moderation / channels | `ban-member`, `upsert-channel-overwrite`, forum/thread types |
|
||||
| Search | `update-search`, `refresh-search`, `remove-search-recent` (v0.8.140) |
|
||||
|
||||
@@ -545,6 +545,15 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
||||
if (guildId && msg.channelId) {
|
||||
await platform.markChannelRead(msg.channelId, guildId)
|
||||
pushState()
|
||||
let dismissChannelId = msg.channelId
|
||||
const channels = (await platform.guild?.listChannels?.()) || []
|
||||
const ch = channels.find((c) => c.id === msg.channelId)
|
||||
if (ch?.type === 'thread' && ch.parentId) dismissChannelId = ch.parentId
|
||||
send({
|
||||
type: 'mark-channel-read-cleared',
|
||||
guildId,
|
||||
channelId: dismissChannelId
|
||||
})
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user