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