mirror of
https://github.com/ragestudio/comty.git
synced 2025-07-11 02:04:15 +00:00
implement forceUpdate
event
This commit is contained in:
parent
9171b9fa03
commit
a85c157003
@ -61,6 +61,7 @@ export function BindContexts(component) {
|
||||
|
||||
export const InternalRouter = withRouter((props) => {
|
||||
const defaultTransitionDelay = 150
|
||||
const forceUpdate = React.useReducer(() => ({}))[1]
|
||||
|
||||
React.useEffect(() => {
|
||||
props.history.listen((event) => {
|
||||
@ -94,6 +95,10 @@ export const InternalRouter = withRouter((props) => {
|
||||
}, delay ?? defaultTransitionDelay)
|
||||
}
|
||||
|
||||
window.app.eventBus.on(`router.forceUpdate`, forceUpdate)
|
||||
|
||||
props.history.lastLocation = window.location
|
||||
|
||||
window.app.setLocation = props.history.setLocation
|
||||
}, [])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user