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
51a79346
Unverified
Commit
51a79346
authored
Feb 26, 2024
by
Zhiyuan Zheng
Committed by
GitHub
Feb 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: firefox/safari to redirect to /explore in HomeLayout (#3001)
parent
8d08cfe1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
HomeLayout.tsx
web/src/layouts/HomeLayout.tsx
+11
-10
No files found.
web/src/layouts/HomeLayout.tsx
View file @
51a79346
import
{
Button
,
IconButton
,
Tooltip
}
from
"@mui/joy"
;
import
{
Button
,
IconButton
,
Tooltip
}
from
"@mui/joy"
;
import
classNames
from
"classnames"
;
import
classNames
from
"classnames"
;
import
{
Suspense
}
from
"react"
;
import
{
Suspense
,
useEffect
}
from
"react"
;
import
{
Outlet
,
useLocation
}
from
"react-router-dom"
;
import
{
Outlet
,
useLocation
}
from
"react-router-dom"
;
import
useLocalStorage
from
"react-use/lib/useLocalStorage"
;
import
useLocalStorage
from
"react-use/lib/useLocalStorage"
;
import
Icon
from
"@/components/Icon"
;
import
Icon
from
"@/components/Icon"
;
...
@@ -19,6 +19,7 @@ const HomeLayout = () => {
...
@@ -19,6 +19,7 @@ const HomeLayout = () => {
const
[
collapsed
,
setCollapsed
]
=
useLocalStorage
<
boolean
>
(
"navigation-collapsed"
,
false
);
const
[
collapsed
,
setCollapsed
]
=
useLocalStorage
<
boolean
>
(
"navigation-collapsed"
,
false
);
// Redirect to explore page if not logged in.
// Redirect to explore page if not logged in.
useEffect
(()
=>
{
if
(
if
(
!
currentUser
&&
!
currentUser
&&
([
Routes
.
HOME
,
Routes
.
TIMELINE
,
Routes
.
RESOURCES
,
Routes
.
INBOX
,
Routes
.
ARCHIVED
,
Routes
.
SETTING
]
as
string
[]).
includes
(
([
Routes
.
HOME
,
Routes
.
TIMELINE
,
Routes
.
RESOURCES
,
Routes
.
INBOX
,
Routes
.
ARCHIVED
,
Routes
.
SETTING
]
as
string
[]).
includes
(
...
@@ -26,8 +27,8 @@ const HomeLayout = () => {
...
@@ -26,8 +27,8 @@ const HomeLayout = () => {
)
)
)
{
)
{
navigateTo
(
"/explore"
);
navigateTo
(
"/explore"
);
return
;
}
}
},
[]);
return
(
return
(
<
div
className=
"w-full min-h-full"
>
<
div
className=
"w-full min-h-full"
>
...
...
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