router.navigate is deprecated use router.navigateTo
The navigate method does not accept a second parameter for replacing state. navigateTo was what was wanted. Mark navigate as deprecated (to match ooui router) to make sure this doesn't happen again. Bug: T226106 Change-Id: Ie86fa632b2175727417b166c222c29bdf12bfea4
This commit is contained in:
parent
e6b4f4f2b2
commit
0a4f88b317
|
@ -384,6 +384,8 @@
|
||||||
toc( currentPage, $toc );
|
toc( currentPage, $toc );
|
||||||
}
|
}
|
||||||
mw.requestIdleCallback( errorLogging );
|
mw.requestIdleCallback( errorLogging );
|
||||||
|
// deprecation notices
|
||||||
|
mw.log.deprecate( router, 'navigate', router.navigate, 'use navigateTo instead' );
|
||||||
} );
|
} );
|
||||||
module.exports = {
|
module.exports = {
|
||||||
overlayManager: overlayManager
|
overlayManager: overlayManager
|
||||||
|
|
|
@ -93,10 +93,10 @@
|
||||||
// Force a change in the address bar
|
// Force a change in the address bar
|
||||||
// This is important is #/talk is the current route
|
// This is important is #/talk is the current route
|
||||||
// (e.g. as is the case after the add discussion overlay has closed)
|
// (e.g. as is the case after the add discussion overlay has closed)
|
||||||
overlayManager.router.navigate( '#/talk/', true );
|
overlayManager.router.navigateTo( '#/talk/', { useReplaceState: true } );
|
||||||
// We use second parameter to turn on replaceState
|
// We use second parameter to turn on replaceState
|
||||||
// this ensure nobody knows above the route change above!
|
// this ensure nobody knows above the route change above!
|
||||||
overlayManager.router.navigate( '#/talk', true );
|
overlayManager.router.navigateTo( '#/talk', { useReplaceState: true } );
|
||||||
}, 300 );
|
}, 300 );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue