Skip to content

Commit

Permalink
fix(web): restore compatibility by rewrites
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Oct 23, 2024
1 parent be07a8d commit 7413762
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/src/pages/Docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ export default function Docs(): JSX.Element {
window.history.pushState(null, '', url)
}

// Keep compatibility with encoded page path
useEffect(() => {
updateUrl(version, hideUi)
}, [])

const iFramePageChanged = (urlPage: string, urlHash: string): void => {
if (urlPage === page.current) {
return
Expand Down
7 changes: 7 additions & 0 deletions web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react'
import { useNavigate } from 'react-router'

import { useProjects } from '../data-providers/ProjectDataProvider'
import { ErrorOutline } from '@mui/icons-material'
Expand All @@ -18,13 +19,19 @@ import LoadingPage from './LoadingPage'
import styles from './../style/pages/Home.module.css'

export default function Home(): JSX.Element {
const navigate = useNavigate()
const { loadingFailed } = useProjects()
const { filteredProjects: projects, query } = useSearch()
const [nonFavoriteProjects, setNonFavoriteProjects] = useState<Project[]>([])
const [favoriteProjects, setFavoriteProjects] = useState<Project[]>([])

document.title = 'Home | docat'

// Keep compatibility with hash-based URI
if (location.hash.startsWith('#/')) {
navigate(location.hash.replace('#', ''), { replace: true })
}

const updateFavorites = (): void => {
if (projects == null) return

Expand Down

0 comments on commit 7413762

Please sign in to comment.