spee.ch/public/assets/js/navBarFunctions.js
2018-01-19 17:24:21 -08:00

15 lines
559 B
JavaScript

function toggleNavBarSelection (value) {
const selectedOption = value;
if (selectedOption === 'LOGOUT') {
// remove session cookies
clearUserCookies();
// send logout request to server
window.location.href = '/logout';
} else if (selectedOption === 'VIEW') {
// get channel info
const channelName = getCookie('CHANNEL_NAME');
const channelClaimId = getCookie('CHANNEL_LONG_ID');
// redirect to channel page
window.location.href = `/${channelName}:${channelClaimId}`;
}
}