mirror of
https://github.com/usememos/memos.git
synced 2025-03-30 10:30:15 +02: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.
|
// 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" {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
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";
|
|||||||
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 = () => {
|
|||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener("resize", handleWindowResize);
|
window.removeEventListener("resize", handleWindowResize);
|
||||||
};
|
};
|
||||||
}, [location]);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
Loading…
x
Reference in New Issue
Block a user