Context Menus: Add "mark as unread" back.

Servers: Fix various issues relating to voice channels.
This commit is contained in:
Paul
2021-06-24 13:07:55 +01:00
parent eef3e11e62
commit 352c0e880c
7 changed files with 40 additions and 23 deletions

View File

@@ -82,7 +82,7 @@ export function UserButton({ active, alert, alertCount, user, context, channel }
}
type ChannelProps = CommonProps & {
channel: Channels.Channel,
channel: Channels.Channel & { unread?: string },
user?: Users.User
compact?: boolean
}
@@ -101,7 +101,7 @@ export function ChannelButton({ active, alert, alertCount, channel, user, compac
data-active={active}
data-alert={typeof alert === 'string'}
className={classNames(styles.item, { [styles.compact]: compact })}
onContextMenu={attachContextMenu('Menu', { channel: channel._id })}>
onContextMenu={attachContextMenu('Menu', { channel: channel._id, unread: typeof channel.unread !== 'undefined' })}>
<div className={styles.avatar}>
<ChannelIcon target={channel} size={compact ? 24 : 32} />
</div>

View File

@@ -47,7 +47,7 @@ function ServerSidebar(props: Props & WithDispatcher) {
if (!server) return <Redirect to="/" />;
const channels = (useChannels(server.channels, ctx)
.filter(entry => typeof entry !== 'undefined') as Readonly<Channels.TextChannel>[])
.filter(entry => typeof entry !== 'undefined') as Readonly<Channels.TextChannel | Channels.VoiceChannel>[])
.map(x => mapChannelWithUnread(x, props.unreads));
const channel = channels.find(x => x?._id === channel_id);