Skip to content

Commit

Permalink
fix: uncreated users alignment on sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkothari22 committed Apr 27, 2024
1 parent 768e0d3 commit e113f7c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export const DirectMessageItemElement = ({ channel, unreadCount }: { channel: DM

return <SidebarItem to={channel.name} className={'py-0.5 px-2'}>
<SidebarIcon>
<UserAvatar src={userData?.user_image} alt={userData?.full_name}
<UserAvatar src={userData?.user_image}
alt={userData?.full_name}
isBot={userData?.type === 'Bot'}
isActive={isActive} size='1' />
</SidebarIcon>
Expand Down Expand Up @@ -145,6 +146,7 @@ const ExtraUsersItem = ({ user, createDMChannel }: { user: ExtraUsersData, creat
const isActive = useIsUserActive(user.name)
return <SidebarButtonItem
isLoading={isLoading}
className={'py-0.5 px-2'}
onClick={onButtonClick}>
<SidebarIcon>
<UserAvatar src={user.user_image} alt={user.full_name} isActive={isActive} isBot={user?.type === 'Bot'} />
Expand Down
2 changes: 1 addition & 1 deletion raven-app/src/utils/channel/ChannelListProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { toast } from 'sonner'
import { getErrorMessage } from '@/components/layout/AlertBanner/ErrorBanner'
import { RavenUser } from '@/types/Raven/RavenUser'

export type ExtraUsersData = Pick<RavenUser, 'name' | 'full_name' | 'user_image' | 'type'>
export type ExtraUsersData = Pick<RavenUser, 'name' | 'user' | 'full_name' | 'user_image' | 'type'>

export type UnreadChannelCountItem = { name: string, user_id?: string, unread_count: number, is_direct_message: 0 | 1 }

Expand Down
7 changes: 3 additions & 4 deletions raven/api/raven_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,12 @@ def get_extra_users(dm_channels):

# Skip permissions since we are only fetching user_id, full_name, and user_image and have applied filters
return frappe.db.get_all(
"User",
"Raven User",
filters=[
["name", "not in", existing_users],
["user", "not in", existing_users],
["enabled", "=", 1],
["Has Role", "role", "=", "Raven User"],
],
fields=["name", "full_name", "user_image", "type"],
fields=["user", "name", "full_name", "first_name", "user_image", "type"],
)


Expand Down

0 comments on commit e113f7c

Please sign in to comment.