How to prevent pushing the current page?

Hi, I have side menu with buttons, each button push to every page in app.

I want to prevent pushing the current page.

If I am in MainPage, and I click on “Main” page in side menu, i want to stay in same page without pushing it.
Any idea? Even an if statement that checking in which page I am right now.

1 Like

It’s not by default? Um…

public openPage(page: any): void {
  if (this.pageRoot !== page.component) {'nav').setRoot(page.component);

PS The code isn’t checked

I have found the solution:

	openPage(component) {
		if(this.rootPage != component) {
			let nav ='nav');