DocSpace-client/packages/common/utils/tryRedirectTo.js

13 lines
211 B
JavaScript
Raw Normal View History

export default function (page) {
if (
window.location.pathname === page ||
window.location.pathname.indexOf(page) !== -1
) {
return false;
}
2023-03-06 08:35:49 +00:00
window.location.replace(page);
return true;
}