Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
b92da8f1
Unverified
Commit
b92da8f1
authored
Feb 11, 2023
by
boojack
Committed by
GitHub
Feb 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: check localsetting exists (#1076)
parent
bdf0c442
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
Memo.tsx
web/src/components/Memo.tsx
+2
-2
PreferencesSection.tsx
web/src/components/Settings/PreferencesSection.tsx
+1
-1
No files found.
web/src/components/Memo.tsx
View file @
b92da8f1
...
@@ -34,7 +34,6 @@ const Memo: React.FC<Props> = (props: Props) => {
...
@@ -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) => {
...
@@ -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
;
...
...
web/src/components/Settings/PreferencesSection.tsx
View file @
b92da8f1
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment