mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
refactor: move event bindings
This commit is contained in:
parent
9ddf4d6068
commit
49df251ed6
2 changed files with 5 additions and 3 deletions
|
|
@ -19,14 +19,12 @@ import * as React from 'react'
|
|||
import { useUpdateEffect } from 'react-use'
|
||||
import { cx } from 'utils/cx'
|
||||
import { parseURLSearch } from 'utils/general'
|
||||
import { loadWithPJAX, useOnPJAXDone, usePJAX, useRedirectedEvents } from 'utils/hooks/usePJAX'
|
||||
import { loadWithPJAX, useOnPJAXDone, usePJAX } from 'utils/hooks/usePJAX'
|
||||
import { useProgressBar } from 'utils/hooks/useProgressBar'
|
||||
import * as keyHelper from 'utils/keyHelper'
|
||||
import { Icon } from './Icon'
|
||||
|
||||
const RawGitako: React.FC<Props & ConnectorState> = function RawGitako(props) {
|
||||
useRedirectedEvents(window, 'pjax:fetch', 'pjax:start', document)
|
||||
useRedirectedEvents(document, 'pjax:ready', 'pjax:end')
|
||||
const configContext = useConfigs()
|
||||
const accessToken = props.configContext.val.access_token
|
||||
const [baseSize] = React.useState(() => configContext.val.sideBarWidth)
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ export function usePJAX() {
|
|||
},
|
||||
})
|
||||
}, [])
|
||||
|
||||
// bindings for legacy support
|
||||
useRedirectedEvents(window, 'pjax:fetch', 'pjax:start', document)
|
||||
useRedirectedEvents(document, 'pjax:ready', 'pjax:end')
|
||||
}
|
||||
|
||||
export const loadWithPJAX = (url: string) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue