fix: resolve P3 audit findings

This commit is contained in:
NimBold
2026-06-15 14:24:34 +03:30
parent 789a8161b2
commit 1b04860c94
9 changed files with 27 additions and 134 deletions
+1 -1
View File
@@ -531,7 +531,7 @@ export const AddDownloadsModal = () => {
let newName = finalFile;
let exists = true;
while (exists) {
while (exists && count < 1000) {
newName = `${base} (${count})${ext}`;
const storeHas = useDownloadStore.getState().downloads.some(d => {
const dest = d.destination || useSettingsStore.getState().defaultDownloadPath || '~/Downloads';
+2 -1
View File
@@ -57,7 +57,8 @@ export const DownloadTable: React.FC<DownloadTableProps> = ({ filter }) => {
} else if (dir === '~') {
resolvedDir = await homeDir();
}
return resolvedDir + '/' + file;
const separator = resolvedDir.endsWith('/') ? '' : '/';
return resolvedDir + separator + file;
};
const filteredDownloads = downloads.filter((d: DownloadItem) => {
+4 -1
View File
@@ -247,7 +247,10 @@ export const Sidebar: React.FC<SidebarProps> = (props) => {
{contextMenu && (
<div
className="fixed z-50 w-48 py-1 rounded-xl shadow-lg border border-border-modal bg-bg-context-menu backdrop-blur-xl animate-fade-in text-[13px] text-text-primary overflow-hidden"
style={{ top: contextMenu.y, left: contextMenu.x }}
style={{
top: Math.min(contextMenu.y, window.innerHeight - 200),
left: Math.min(contextMenu.x, window.innerWidth - 200)
}}
onClick={e => e.stopPropagation()}
>
<button