Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions web-app/src/containers/DownloadManegement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -400,20 +400,23 @@ export function DownloadManagement() {
className="text-main-view-fg/70 cursor-pointer"
title="Cancel download"
onClick={() => {
serviceHub.models().abortDownload(download.name).then(() => {
toast.info(
t('common:toast.downloadCancelled.title'),
{
id: 'cancel-download',
description: t(
'common:toast.downloadCancelled.description'
),
serviceHub
.models()
.abortDownload(download.name)
.then(() => {
toast.info(
t('common:toast.downloadCancelled.title'),
{
id: 'cancel-download',
description: t(
'common:toast.downloadCancelled.description'
),
}
)
if (downloadProcesses.length === 0) {
setIsPopoverOpen(false)
}
)
if (downloadProcesses.length === 0) {
setIsPopoverOpen(false)
}
})
})
}}
/>
</div>
Expand Down
24 changes: 9 additions & 15 deletions web-app/src/containers/LeftPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import { DownloadManagement } from '@/containers/DownloadManegement'
import { useSmallScreen } from '@/hooks/useMediaQuery'
import { useClickOutside } from '@/hooks/useClickOutside'
import { useDownloadStore } from '@/hooks/useDownloadStore'

import { DeleteAllThreadsDialog } from '@/containers/dialogs'

const mainMenus = [
Expand Down Expand Up @@ -122,7 +122,7 @@
) {
if (currentIsSmallScreen && open) {
setLeftPanel(false)
} else if(!open) {
} else if (!open) {
setLeftPanel(true)
}
prevScreenSizeRef.current = currentIsSmallScreen
Expand All @@ -141,7 +141,7 @@
return () => {
window.removeEventListener('resize', handleResize)
}
}, [setLeftPanel])

Check warning on line 144 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / base_branch_cov

React Hook useEffect has a missing dependency: 'open'. Either include it or remove the dependency array

Check warning on line 144 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / test-on-macos

React Hook useEffect has a missing dependency: 'open'. Either include it or remove the dependency array

Check warning on line 144 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / test-on-ubuntu

React Hook useEffect has a missing dependency: 'open'. Either include it or remove the dependency array

Check warning on line 144 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / coverage-check

React Hook useEffect has a missing dependency: 'open'. Either include it or remove the dependency array

Check warning on line 144 in web-app/src/containers/LeftPanel.tsx

View workflow job for this annotation

GitHub Actions / test-on-windows-pr

React Hook useEffect has a missing dependency: 'open'. Either include it or remove the dependency array

const currentPath = useRouterState({
select: (state) => state.location.pathname,
Expand Down Expand Up @@ -179,8 +179,6 @@
}
}, [isSmallScreen, open])

const { downloads, localDownloadingModels } = useDownloadStore()

return (
<>
{/* Backdrop overlay for small screens */}
Expand Down Expand Up @@ -262,15 +260,8 @@
)}
</div>

<div className="flex flex-col justify-between overflow-hidden mt-0 !h-[calc(100%-42px)]">
<div
className={cn(
'flex flex-col',
Object.keys(downloads).length > 0 || localDownloadingModels.size > 0
? 'h-[calc(100%-200px)]'
: 'h-[calc(100%-140px)]'
)}
>
<div className="flex flex-col justify-between overflow-hidden mt-0 !h-[calc(100%-42px)] ">
<div className={cn('flex flex-col !h-[calc(100%-200px)]')}>
{IS_MACOS && (
<div
ref={searchContainerMacRef}
Expand Down Expand Up @@ -379,7 +370,9 @@
</button>
</DropdownMenuTrigger>
<DropdownMenuContent side="bottom" align="end">
<DeleteAllThreadsDialog onDeleteAll={deleteAllThreads} />
<DeleteAllThreadsDialog
onDeleteAll={deleteAllThreads}
/>
</DropdownMenuContent>
</DropdownMenu>
</div>
Expand Down Expand Up @@ -468,8 +461,9 @@
</Link>
)
})}
<DownloadManagement />
</div>

<DownloadManagement />
</div>
</aside>
</>
Expand Down
Loading
Loading