Skip to content

Commit

Permalink
Merge pull request #1 from Marvelxy/calendar-link
Browse files Browse the repository at this point in the history
Add fix for calendar navigation.
  • Loading branch information
Marvelxy authored Jun 30, 2021
2 parents ac1e4c8 + 8dcd7b5 commit d9cb173
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions javascripts/discourse/connectors/below-footer/custom-footer.js.es6
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,25 @@ export default {
{title: 'Tasks', text: 'Tasks', link: '' /*`/tag/${newSplittedURL[0].split('/')[2]}/l/latest`*/}
];
}
else if(newSplittedURL[0].split('/')[1] === 'c' || newSplittedURL[0].split('/')[1] === 't'){
// This handles calendar navigation
const calenderSplittedURL = newSplittedURL[0].split('/');
if(calenderSplittedURL.includes('calendar')){
calenderSplittedURL.splice(-2, 2);
mainHeading = [
{title: 'Latest', text: 'Latest', link: '/latest'},
{title: 'Stats', text: 'My Stats', link: `/u/${userName}/summary`},
{title: 'Back', text: 'Back', link: `${calenderSplittedURL.join('/')}`}
];
}
else{
mainHeading = [
{title: 'Latest', text: 'Latest', link: '/latest'},
{title: 'Stats', text: 'My Stats', link: `/u/${userName}/summary`},
{title: 'Calendar', text: 'Calendar', link: `${newSplittedURL}/l/calendar`}
];
}
}
else{
mainHeading = [
{title: 'Latest', text: 'Latest', link: '/latest'},
Expand Down

0 comments on commit d9cb173

Please sign in to comment.