chore: update version to 0.12.2 ()

This commit is contained in:
boojack 2023-04-16 10:40:21 +08:00 committed by GitHub
parent 3060dafb45
commit 58fa00079b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 6 deletions
server/version
web/src/components

@ -9,10 +9,10 @@ import (
// Version is the service current released version.
// Semantic versioning: https://semver.org/
var Version = "0.12.1"
var Version = "0.12.2"
// DevVersion is the service current development version.
var DevVersion = "0.12.1"
var DevVersion = "0.12.2"
func GetCurrentVersion(mode string) string {
if mode == "dev" || mode == "demo" {

@ -1,5 +1,4 @@
import { useEffect } from "react";
import { useLocation } from "react-router-dom";
import { resolution } from "../utils/layout";
import { useLayoutStore, useUserStore } from "../store/module";
import ShortcutList from "./ShortcutList";
@ -8,19 +7,29 @@ import SearchBar from "./SearchBar";
import UsageHeatMap from "./UsageHeatMap";
const HomeSidebar = () => {
const location = useLocation();
const layoutStore = useLayoutStore();
const userStore = useUserStore();
const showHomeSidebar = layoutStore.state.showHomeSidebar;
useEffect(() => {
let initialized = false;
let lastStatus = layoutStore.state.showHomeSidebar;
const handleWindowResize = () => {
const nextStatus = window.innerWidth < resolution.md;
let nextStatus = window.innerWidth < resolution.md;
if (lastStatus !== nextStatus) {
if (!initialized && nextStatus) {
// Don't show sidebar on first load in mobile view.
nextStatus = false;
}
layoutStore.setHomeSidebarStatus(nextStatus);
lastStatus = nextStatus;
}
if (!initialized) {
initialized = true;
return;
}
};
window.addEventListener("resize", handleWindowResize);
@ -29,7 +38,7 @@ const HomeSidebar = () => {
return () => {
window.removeEventListener("resize", handleWindowResize);
};
}, [location]);
}, []);
return (
<div