mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
f375362894
* Always use mockable location methods * Add eslint rules for window.location calls/assignment * Add useLocation hook * Update tests GitOrigin-RevId: eafb846db89f884a7a9a8570cce7745be605152c
11 lines
319 B
JavaScript
11 lines
319 B
JavaScript
// window location-related functions in a separate module so they can be mocked/stubbed in tests
|
|
|
|
export function reload() {
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
window.location.reload()
|
|
}
|
|
|
|
export function assign(url) {
|
|
// eslint-disable-next-line no-restricted-syntax
|
|
window.location.assign(url)
|
|
}
|