mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-07-19 03:23:11 -04:00
main.js: fix empty window opened in some cases (#5146)
Fixes the following problem: 1. Don't have any article selected (easiest by clicking on "main stream" or a category) 2. Press space 3. A blank window is opened, but since there's no link nothing else happens.
This commit is contained in:
@@ -1013,11 +1013,13 @@ function init_shortcuts() {
|
||||
}
|
||||
|
||||
const link_go_website = document.querySelector('.flux.current a.go_website');
|
||||
const newWindow = window.open();
|
||||
if (link_go_website && newWindow) {
|
||||
newWindow.opener = null;
|
||||
newWindow.location = link_go_website.href;
|
||||
ev.preventDefault();
|
||||
if (link_go_website) {
|
||||
const newWindow = window.open();
|
||||
if (newWindow) {
|
||||
newWindow.opener = null;
|
||||
newWindow.location = link_go_website.href;
|
||||
ev.preventDefault();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user