Clicking on browser notification for chrome will now open new window (#7068)

This commit is contained in:
Aniket Katkar 2022-08-31 00:16:56 +05:30 committed by GitHub
parent 6547beeffc
commit d438fbead8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -154,7 +154,14 @@ const NavBar = ({
icon: Logo,
});
notification.onclick = () => {
history.push(path);
const isChrome = window.navigator.userAgent.indexOf('Chrome');
// Applying logic to open a new window onclick of browser notification from chrome
// As it does not open the concerned tab by default.
if (isChrome > -1) {
window.open(path);
} else {
history.push(path);
}
};
};