Skip to content

A free, self-hostable news aggregator…

Fix auto-share shortcut on first use (#9072)

Gerard Alvear Porras1460e7573034
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 8b5199b58..a05ff2a5b 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -873,9 +873,10 @@ function auto_share(key) {
if (!share) {
return;
}
- const shares = share.parentElement.querySelectorAll('.dropdown-menu .item [data-type]');
+ let shares;
if (typeof key === 'undefined') {
show_share_menu(share);
+ shares = share.parentElement.querySelectorAll('.dropdown-menu .item [data-type]');
// Display the share div
location.hash = share.id;
@@ -895,6 +896,7 @@ function auto_share(key) {
return;
}
}
+ shares = share.parentElement.querySelectorAll('.dropdown-menu .item [data-type]');
// Trigger selected share action and hide the share div
key = parseInt(key);
if (key <= shares.length) {