Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VCCI-News
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ăn Hoàng
VCCI-News
Commits
d9a52db6
Commit
d9a52db6
authored
May 20, 2026
by
Lê Bảo Hồng Đức
☄
Browse files
Options
Browse Files
Download
Plain Diff
fix
parents
8c9baba4
f680aadf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
39 deletions
+41
-39
page.tsx
src/app/admin/base-config/page.tsx
+9
-4
useAuthStore.ts
src/store/useAuthStore.ts
+32
-34
_themes.css
src/styles/_themes.css
+0
-1
No files found.
src/app/admin/base-config/page.tsx
View file @
d9a52db6
...
...
@@ -649,6 +649,7 @@ export default function AdminBaseConfigPage() {
const
handleDeleteItem
=
async
()
=>
{
if
(
!
config
||
!
deleteTarget
)
return
;
try
{
const
nextConfig
=
cloneBaseConfigData
(
config
);
if
(
deleteTarget
.
mode
===
"logo"
)
{
...
...
@@ -670,7 +671,11 @@ export default function AdminBaseConfigPage() {
saveConfig
(
nextConfig
);
toast
.
success
(
"Đã xóa cấu hình"
);
}
catch
(
err
)
{
toast
.
error
(
err
instanceof
Error
?
err
.
message
:
"Không thể xóa cấu hình"
);
}
finally
{
setDeleteTarget
(
null
);
}
};
const
handleBranchChange
=
<
K
extends
keyof
BaseConfigBranchItem
>
(
...
...
src/store/useAuthStore.ts
View file @
d9a52db6
...
...
@@ -124,11 +124,8 @@ const normalizePersistedAuthState = (
const
persistSession
=
persisted
.
appPersistSession
===
true
;
const
refreshTokenExpiredAt
=
getRefreshTokenExpiredAt
(
persisted
.
appSession
??
null
);
const
hasUsableSession
=
persistSession
&&
Boolean
(
persisted
.
appRefreshToken
)
&&
(
!
refreshTokenExpiredAt
||
refreshTokenExpiredAt
>
Date
.
now
())
&&
(
!
persisted
.
appAccessTokenExpired
||
typeof
persisted
.
appAccessTokenExpired
===
"number"
);
(
!
refreshTokenExpiredAt
||
refreshTokenExpiredAt
>
Date
.
now
());
if
(
!
hasUsableSession
)
{
return
{
...
...
@@ -141,25 +138,12 @@ const normalizePersistedAuthState = (
return
{
...
currentState
,
...
persisted
,
appPersistSession
:
true
,
appPersistSession
:
persistSession
,
appUserRemember
:
rememberState
,
appIsRefreshing
:
false
,
};
};
const
shouldPersistAuthStorage
=
(
value
:
string
)
=>
{
try
{
const
parsed
=
JSON
.
parse
(
value
)
as
{
state
?:
Partial
<
AuthStoreStateType
>
;
};
const
state
=
parsed
.
state
??
{};
return
state
.
appPersistSession
===
true
||
state
.
appUserRemember
?.
remember
===
true
;
}
catch
{
return
true
;
}
};
const
useAuthStore
=
create
<
AuthStoreStateType
>
()(
devtools
(
persist
(
...
...
@@ -252,21 +236,37 @@ const useAuthStore = create<AuthStoreStateType>()(
{
name
:
"app-auth-storage"
,
storage
:
createJSONStorage
(()
=>
({
getItem
:
(
name
)
=>
localStorage
.
getItem
(
name
),
getItem
:
(
name
)
=>
{
if
(
typeof
window
===
"undefined"
)
return
null
;
return
localStorage
.
getItem
(
name
)
??
sessionStorage
.
getItem
(
name
);
},
setItem
:
(
name
,
value
)
=>
{
if
(
shouldPersistAuthStorage
(
value
))
{
if
(
typeof
window
===
"undefined"
)
return
;
try
{
const
parsed
=
JSON
.
parse
(
value
)
as
{
state
?:
Partial
<
AuthStoreStateType
>
;
};
const
state
=
parsed
.
state
??
{};
if
(
state
.
appPersistSession
===
true
)
{
localStorage
.
setItem
(
name
,
value
);
return
;
sessionStorage
.
removeItem
(
name
);
}
else
{
sessionStorage
.
setItem
(
name
,
value
);
localStorage
.
removeItem
(
name
);
}
}
catch
{
localStorage
.
setItem
(
name
,
value
);
}
},
removeItem
:
(
name
)
=>
{
if
(
typeof
window
===
"undefined"
)
return
;
localStorage
.
removeItem
(
name
);
sessionStorage
.
removeItem
(
name
);
},
removeItem
:
(
name
)
=>
localStorage
.
removeItem
(
name
),
})),
partialize
:
(
state
)
=>
({
appPersistSession
:
state
.
appPersistSession
,
...(
state
.
appPersistSession
?
{
appIsLoggedIn
:
state
.
appIsLoggedIn
,
appAccessToken
:
state
.
appAccessToken
,
appAccessTokenExpired
:
state
.
appAccessTokenExpired
,
...
...
@@ -274,8 +274,6 @@ const useAuthStore = create<AuthStoreStateType>()(
appSession
:
state
.
appSession
,
appUser
:
state
.
appUser
,
appSessionExpiredNotified
:
state
.
appSessionExpiredNotified
,
}
:
{}),
appUserRemember
:
state
.
appUserRemember
,
}),
merge
:
(
persistedState
,
currentState
)
=>
...
...
src/styles/_themes.css
View file @
d9a52db6
...
...
@@ -3,7 +3,6 @@
@theme
inline
{
/* Fonts */
--font-reddit-sans
:
RedditSans
,
sans-serif
;
/* Use Roboto as the default font. Ensure Roboto is loaded (e.g., via Google Fonts or local import). */
--default-font-family
:
'Roboto'
,
'Helvetica Neue'
,
Arial
,
system-ui
,
-apple-system
,
'Segoe UI'
,
'Noto Sans'
,
sans-serif
;
/* Border Radius */
--radius-lg
:
hsl
(
var
(
--radius
));
...
...
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