Skip to content

Commit

Permalink
slight bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adunndevster2 committed Jan 28, 2024
1 parent 009b2d1 commit 062b645
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/theme/TOC/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ function getDocusaurusTabItems() {
export default function TOC({ className, ...props }) {
const forceUpdate = useForceUpdate();
let activeTab, setActiveTab;
// let [activeTab, setActiveTab] =
// useState(localStorage.getItem("docusaurus.tab.ide")) &&
// useState(localStorage.getItem("docusaurus.tab.os"));
// [activeTab, setActiveTab] = useState(
// localStorage.getItem("docusaurus.tab.os")
// );
function setupUseTabState() {
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i);
Expand Down Expand Up @@ -87,7 +81,7 @@ export default function TOC({ className, ...props }) {
const handleStorageChange = (event) => {
if (event.key.includes("docusaurus.tab")) {
const newActiveTab = localStorage.getItem(event.key);
setActiveTab(newActiveTab);
if(setActiveTab) setActiveTab(newActiveTab);
}
};

Expand Down

0 comments on commit 062b645

Please sign in to comment.