Skip to content

Commit

Permalink
fix: pass sitename to SocketIO. Do not pass if v14
Browse files Browse the repository at this point in the history
fix: width of message item content
  • Loading branch information
nikkothari22 committed Dec 17, 2024
1 parent b0d1f4e commit 4779866
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,18 @@ function App() {

const [appearance, setAppearance] = useStickyState<'light' | 'dark' | 'inherit'>('dark', 'appearance');

// We need to pass sitename only if the Frappe version is v15 or above.
// We not need to pass sitename if the Frappe version is v14.

const getSiteName = () => {
// @ts-ignore
if (window.frappe?.boot?.versions?.frappe && (window.frappe.boot.versions.frappe.startsWith('15') || window.frappe.boot.versions.frappe.startsWith('16'))) {
if (window.frappe?.boot?.versions?.frappe.startsWith('14')) {
return import.meta.env.VITE_SITE_NAME
}
// @ts-ignore
else {
// @ts-ignore
return window.frappe?.boot?.sitename ?? import.meta.env.VITE_SITE_NAME
}
return import.meta.env.VITE_SITE_NAME

}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const MessageItem = ({ message, setDeleteMessage, isHighlighted, onReplyM
rounded-md`, isHighlighted ? 'bg-yellow-50 hover:bg-yellow-50 dark:bg-yellow-300/20 dark:hover:bg-yellow-300/20' : !isDesktop && isHovered ? 'bg-gray-2 dark:bg-gray-3' : '', isEmojiPickerOpen ? 'bg-gray-2 dark:bg-gray-3' : '')}>
<Flex className='gap-2.5 sm:gap-3 items-start'>
<MessageLeftElement message={message} user={user} isActive={isActive} />
<Flex direction='column' className='gap-0.5' justify='center' width='100%'>
<Flex direction='column' className='gap-0.5 w-[90%]' justify='center'>
{!is_continuation ? <Flex align='center' gap='2' mt='-1'>
<UserHoverCard
user={user}
Expand Down

0 comments on commit 4779866

Please sign in to comment.