Home

Issue: 3058

Do you think that this is possible?

[issue link]

Hi so basically I’ve got a Object called resumeNotification that looks like this:

const resumeNotification = {
	message: 'Would you like to continue from where you\'ve last left of?',
	timeout: 3000,
};

and a method called showNotification that creates a notification out of the Object.

and what I want to do is on the first time you access a page that’s on the same path level. I want to show that notification (I basically want to call that showNotification method)

So for example if you access site.com/shows/breaking-bad/1 I want to show you that notification. But then if you go to site.com/shows/breaking-bad/2 by clicking on the episode link, I don’t want to show you it again.

However, if you directly access site.com/shows/breaking-bad/2 by typing it then I want you to get it again.

Also, if you access site.com/shows/breaking-bad/2 from a page that a level below or above then you also get to see it.

I hope that makes sense. Do you think that’s possible to do? I basically just want to call a method when access a page that’s on the same path level for the first time.

I tried using created but the page gets re-created whenever you change episodes. I also tried mounted but the page gets re-mounted whenever you change episode.

Btw, I want to show the notification only after the show is ready to play. So I can’t use anything from asyncData or fetch since those functions get called before the video player has even loaded.

If there’s a way that I can make a certain data variable not change when you change episodes then I think I know how I can do it.

This question is available on Nuxt.js community (#c2647)