Unverified Commit 58fa0007 authored by boojack's avatar boojack Committed by GitHub

chore: update version to `0.12.2` (#1538)

parent 3060dafb
...@@ -9,10 +9,10 @@ import ( ...@@ -9,10 +9,10 @@ import (
// Version is the service current released version. // Version is the service current released version.
// Semantic versioning: https://semver.org/ // Semantic versioning: https://semver.org/
var Version = "0.12.1" var Version = "0.12.2"
// DevVersion is the service current development version. // DevVersion is the service current development version.
var DevVersion = "0.12.1" var DevVersion = "0.12.2"
func GetCurrentVersion(mode string) string { func GetCurrentVersion(mode string) string {
if mode == "dev" || mode == "demo" { if mode == "dev" || mode == "demo" {
......
import { useEffect } from "react"; import { useEffect } from "react";
import { useLocation } from "react-router-dom";
import { resolution } from "../utils/layout"; import { resolution } from "../utils/layout";
import { useLayoutStore, useUserStore } from "../store/module"; import { useLayoutStore, useUserStore } from "../store/module";
import ShortcutList from "./ShortcutList"; import ShortcutList from "./ShortcutList";
...@@ -8,19 +7,29 @@ import SearchBar from "./SearchBar"; ...@@ -8,19 +7,29 @@ import SearchBar from "./SearchBar";
import UsageHeatMap from "./UsageHeatMap"; import UsageHeatMap from "./UsageHeatMap";
const HomeSidebar = () => { const HomeSidebar = () => {
const location = useLocation();
const layoutStore = useLayoutStore(); const layoutStore = useLayoutStore();
const userStore = useUserStore(); const userStore = useUserStore();
const showHomeSidebar = layoutStore.state.showHomeSidebar; const showHomeSidebar = layoutStore.state.showHomeSidebar;
useEffect(() => { useEffect(() => {
let initialized = false;
let lastStatus = layoutStore.state.showHomeSidebar; let lastStatus = layoutStore.state.showHomeSidebar;
const handleWindowResize = () => { const handleWindowResize = () => {
const nextStatus = window.innerWidth < resolution.md; let nextStatus = window.innerWidth < resolution.md;
if (lastStatus !== nextStatus) { if (lastStatus !== nextStatus) {
if (!initialized && nextStatus) {
// Don't show sidebar on first load in mobile view.
nextStatus = false;
}
layoutStore.setHomeSidebarStatus(nextStatus); layoutStore.setHomeSidebarStatus(nextStatus);
lastStatus = nextStatus; lastStatus = nextStatus;
} }
if (!initialized) {
initialized = true;
return;
}
}; };
window.addEventListener("resize", handleWindowResize); window.addEventListener("resize", handleWindowResize);
...@@ -29,7 +38,7 @@ const HomeSidebar = () => { ...@@ -29,7 +38,7 @@ const HomeSidebar = () => {
return () => { return () => {
window.removeEventListener("resize", handleWindowResize); window.removeEventListener("resize", handleWindowResize);
}; };
}, [location]); }, []);
return ( return (
<div <div
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment