Skip to content

Commit

Permalink
Open selected stories when pressing "o"
Browse files Browse the repository at this point in the history
Note: Trying to open multiple URLs from code in succession might trigger
the browser's pop-up protection and block them from being opened.
  • Loading branch information
pmeinhardt committed May 15, 2022
1 parent 13011fb commit aaf2af0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const queue = new Queue({ concurrency: 4 });

const cls = (...args) => args.filter((c) => c).join(" ");

const open = ({ url }) => window.open(url, "_blank");

const pageSize = 30;

function Loader() {
Expand Down Expand Up @@ -114,7 +116,7 @@ function List({ keys }) {
Object.entries(selection)
.filter(([, selected]) => selected)
.map(([key]) => data[key])
.forEach(console.log);
.forEach(open);
break;

default:
Expand Down

0 comments on commit aaf2af0

Please sign in to comment.