mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: check localsetting exists (#1076)
This commit is contained in:
@ -34,7 +34,6 @@ const Memo: React.FC<Props> = (props: Props) => {
|
|||||||
const locationStore = useLocationStore();
|
const locationStore = useLocationStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const memoStore = useMemoStore();
|
const memoStore = useMemoStore();
|
||||||
const { localSetting } = userStore.state.user as User;
|
|
||||||
const [displayTimeStr, setDisplayTimeStr] = useState<string>(getFormatedMemoTimeStr(memo.displayTs, i18n.language));
|
const [displayTimeStr, setDisplayTimeStr] = useState<string>(getFormatedMemoTimeStr(memo.displayTs, i18n.language));
|
||||||
const memoContainerRef = useRef<HTMLDivElement>(null);
|
const memoContainerRef = useRef<HTMLDivElement>(null);
|
||||||
const isVisitorMode = userStore.isVisitorMode();
|
const isVisitorMode = userStore.isVisitorMode();
|
||||||
@ -152,7 +151,8 @@ const Memo: React.FC<Props> = (props: Props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleMemoContentDoubleClick = (e: React.MouseEvent) => {
|
const handleMemoContentDoubleClick = (e: React.MouseEvent) => {
|
||||||
if (!localSetting.enableDoubleClickEditing) {
|
const loginUser = userStore.state.user;
|
||||||
|
if (loginUser && !loginUser.localSetting.enableDoubleClickEditing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const targetEl = e.target as HTMLElement;
|
const targetEl = e.target as HTMLElement;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { Select, Switch, Option } from "@mui/joy";
|
import { Select, Switch, Option } from "@mui/joy";
|
||||||
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useGlobalStore, useUserStore } from "../../store/module";
|
import { useGlobalStore, useUserStore } from "../../store/module";
|
||||||
import { VISIBILITY_SELECTOR_ITEMS, MEMO_DISPLAY_TS_OPTION_SELECTOR_ITEMS } from "../../helpers/consts";
|
import { VISIBILITY_SELECTOR_ITEMS, MEMO_DISPLAY_TS_OPTION_SELECTOR_ITEMS } from "../../helpers/consts";
|
||||||
import AppearanceSelect from "../AppearanceSelect";
|
import AppearanceSelect from "../AppearanceSelect";
|
||||||
import LocaleSelect from "../LocaleSelect";
|
import LocaleSelect from "../LocaleSelect";
|
||||||
import "../../less/settings/preferences-section.less";
|
import "../../less/settings/preferences-section.less";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
const PreferencesSection = () => {
|
const PreferencesSection = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
Reference in New Issue
Block a user