Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
2f91d8cc
authored
Jul 06, 2026
by
G.RQ
Committed by
GitHub
Jul 06, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(web): sync home iframe theme and language (#5917)
parent
043720f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletions
+28
-1
web/default/src/features/home/index.tsx
+28
-1
No files found.
web/default/src/features/home/index.tsx
View file @
2f91d8cc
...
@@ -16,11 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
...
@@ -16,11 +16,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
For commercial licensing, please contact support@quantumnous.com
*/
*/
import
{
useCallback
,
useEffect
,
useRef
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
useTranslation
}
from
'react-i18next'
import
{
PublicLayout
}
from
'@/components/layout'
import
{
PublicLayout
}
from
'@/components/layout'
import
{
Footer
}
from
'@/components/layout/components/footer'
import
{
Footer
}
from
'@/components/layout/components/footer'
import
{
RichContent
}
from
'@/components/rich-content'
import
{
RichContent
}
from
'@/components/rich-content'
import
{
useTheme
}
from
'@/context/theme-provider'
import
{
isLikelyHtml
}
from
'@/lib/content-format'
import
{
isLikelyHtml
}
from
'@/lib/content-format'
import
{
useAuthStore
}
from
'@/stores/auth-store'
import
{
useAuthStore
}
from
'@/stores/auth-store'
...
@@ -28,11 +30,34 @@ import { CTA, Features, Hero, HowItWorks, Stats } from './components'
...
@@ -28,11 +30,34 @@ import { CTA, Features, Hero, HowItWorks, Stats } from './components'
import
{
useHomePageContent
}
from
'./hooks'
import
{
useHomePageContent
}
from
'./hooks'
export
function
Home
()
{
export
function
Home
()
{
const
{
t
}
=
useTranslation
()
const
{
i18n
,
t
}
=
useTranslation
()
const
iframeRef
=
useRef
<
HTMLIFrameElement
>
(
null
)
const
{
resolvedTheme
}
=
useTheme
()
const
{
auth
}
=
useAuthStore
()
const
{
auth
}
=
useAuthStore
()
const
isAuthenticated
=
!!
auth
.
user
const
isAuthenticated
=
!!
auth
.
user
const
{
content
,
isLoaded
,
isUrl
}
=
useHomePageContent
()
const
{
content
,
isLoaded
,
isUrl
}
=
useHomePageContent
()
const
syncIframePreferences
=
useCallback
(()
=>
{
try
{
iframeRef
.
current
?.
contentWindow
?.
postMessage
(
{
themeMode
:
resolvedTheme
},
'*'
)
iframeRef
.
current
?.
contentWindow
?.
postMessage
(
{
lang
:
i18n
.
language
},
'*'
)
}
catch
{
// Cross-origin frames may reject access while navigating.
}
},
[
i18n
.
language
,
resolvedTheme
])
useEffect
(()
=>
{
if
(
isUrl
)
{
syncIframePreferences
()
}
},
[
isUrl
,
syncIframePreferences
])
if
(
!
isLoaded
)
{
if
(
!
isLoaded
)
{
return
(
return
(
<
PublicLayout
showMainContainer=
{
false
}
>
<
PublicLayout
showMainContainer=
{
false
}
>
...
@@ -48,10 +73,12 @@ export function Home() {
...
@@ -48,10 +73,12 @@ export function Home() {
return
(
return
(
<
PublicLayout
showMainContainer=
{
false
}
>
<
PublicLayout
showMainContainer=
{
false
}
>
<
iframe
<
iframe
ref=
{
iframeRef
}
src=
{
content
}
src=
{
content
}
className=
'h-screen w-full border-none'
className=
'h-screen w-full border-none'
title=
{
t
(
'Custom Home Page'
)
}
title=
{
t
(
'Custom Home Page'
)
}
sandbox=
'allow-forms allow-popups allow-popups-to-escape-sandbox allow-scripts'
sandbox=
'allow-forms allow-popups allow-popups-to-escape-sandbox allow-scripts'
onLoad=
{
syncIframePreferences
}
/>
/>
</
PublicLayout
>
</
PublicLayout
>
)
)
...
...
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