Skip to content

Commit

Permalink
Merge branch 'master' into fix/misc-styles
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 authored Dec 11, 2023
2 parents 84d545d + e52cfc9 commit 57b63ef
Show file tree
Hide file tree
Showing 21 changed files with 2,446 additions and 2,915 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/publish-rolling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ jobs:
tar xvf *.tgz --strip-components=1
- name: Build executables
run: |
pkg . --out-path dist-pkg
run: npm run pkg

- name: Rename linuxstatic to linux
run: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ EXPOSE 3000
EXPOSE 4200

# Flood server in development mode
ENTRYPOINT ["npm", "--prefix=/usr/src/app/", "run", "start:development:server", "--", "--host=0.0.0.0"]
ENTRYPOINT ["npm", "--prefix=/usr/src/app/", "run", "start", "--", "--host=0.0.0.0"]

# Then, to start a debugging session of frontend:
# docker exec -it ${container_id} npm --prefix=/usr/src/app/ run start:development:client
Expand All @@ -61,4 +61,4 @@ FROM flood as rtorrent-flood
# Copy rTorrent
COPY --from=rtorrent / /

ENTRYPOINT ["npm", "--prefix=/usr/src/app/", "run", "start:development:server", "--", "--host=0.0.0.0", "--rtorrent"]
ENTRYPOINT ["npm", "--prefix=/usr/src/app/", "run", "start", "--", "--host=0.0.0.0", "--rtorrent"]
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ const NotificationTopToolbar: FC<NotificationTopToolbarProps> = ({
};

interface NotificationItemProps {
index: number;
notification: Notification;
}

const NotificationItem: FC<NotificationItemProps> = ({index, notification}: NotificationItemProps) => {
const NotificationItem: FC<NotificationItemProps> = ({notification}: NotificationItemProps) => {
const {i18n} = useLingui();

return (
<li className="notifications__list__item" key={index}>
<li className="notifications__list__item">
<div className="notification__heading">
<span className="notification__category">{i18n._(`${notification.id}.heading`)}</span>
{' — '}
Expand Down Expand Up @@ -195,7 +194,7 @@ const NotificationsButton: FC = observer(() => {
style={{minHeight: prevHeight}}
>
{notifications.map((notification, index) => (
<NotificationItem index={index} notification={notification} />
<NotificationItem key={index} notification={notification} />
))}
</ul>
<NotificationBottomToolbar
Expand Down
2 changes: 1 addition & 1 deletion client/src/javascript/components/sidebar/SidebarFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const SidebarFilter: FC<SidebarFilterProps> = ({
{icon}
<span className="name">{name}</span>
<Badge>{count}</Badge>
{size && <Size value={size} className="size" />}
{size != null && <Size value={size} className="size" />}
</button>
</li>
);
Expand Down
15 changes: 14 additions & 1 deletion client/src/javascript/components/torrent-list/TorrentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import SettingStore from '@client/stores/SettingStore';
import TorrentFilterStore from '@client/stores/TorrentFilterStore';
import TorrentStore from '@client/stores/TorrentStore';
import SortDirections from '@client/constants/SortDirections';
import UIStore from '@client/stores/UIStore';

import type {TorrentListColumn} from '@client/constants/TorrentListColumns';

Expand Down Expand Up @@ -50,7 +51,7 @@ const TorrentList: FC = observer(() => {
useEvent('keydown', (e: KeyboardEvent) => {
const {ctrlKey, key, metaKey, repeat, target} = e;

const tagName = (target as HTMLElement)?.tagName.toUpperCase();
const tagName = (target as HTMLElement)?.tagName?.toUpperCase();
if (tagName === 'INPUT' || tagName === 'TEXTAREA') {
return;
}
Expand All @@ -63,6 +64,18 @@ const TorrentList: FC = observer(() => {
e.preventDefault();
TorrentStore.selectAllTorrents();
}

if ((metaKey || ctrlKey) && key === 'v') {
(async () => {
const text = await navigator?.clipboard?.readText();
const isMagnetLink = text?.startsWith('magnet:?');
const isTorrentLink = text?.startsWith('http') && text?.endsWith('.torrent');
if (isMagnetLink || isTorrentLink) {
e.preventDefault();
UIStore.setActiveModal({id: 'add-torrents', tab: 'by-url', urls: [{id: 0, value: text}]});
}
})();
}
});

const torrents = TorrentStore.filteredTorrents;
Expand Down
Loading

0 comments on commit 57b63ef

Please sign in to comment.