Skip to content

Commit

Permalink
Merge pull request #94 from ksqsf/master
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 authored Jan 3, 2024
2 parents 0a65fb7 + d495c6b commit c93149b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PageTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,15 @@ function getBlockUUID(element: HTMLElement) {

function getJournalsString(): string {
let storedJournalsString = localStorage.getItem("journalsString");

if (!storedJournalsString) {
let readJournalsString = top?.document.querySelector(".journals-nav")?.firstChild?.lastChild?.textContent;
let readJournalsString = top?.document.querySelector(".journals-nav")?.firstChild?.children[1]?.textContent;

// Be careful if we read "gj": it's likely because we selected the wrong element.
if (readJournalsString && readJournalsString == "gj") {
readJournalsString = top?.document.querySelector(".journals-nav")?.firstChild?.lastChild?.textContent;
}

if (readJournalsString) {
storedJournalsString = readJournalsString;
} else {
Expand Down

0 comments on commit c93149b

Please sign in to comment.