mirror of
https://github.com/usememos/memos.git
synced 2025-03-17 03:00:13 +01:00
chore: update version to 0.12.2
(#1538)
This commit is contained in:
parent
3060dafb45
commit
58fa00079b
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user