So why are we getting this error here?
Well, we're trying to navigate to a root or to a screen named shop now.
We had that in the past year and our switch navigator there, we had the shop screen.
But now we have a different logic for rendering this navigator and all the screens and sub navigators
that belong to it.
So let's actually go to the place where we triggered this navigation action.
And that's actually on the off screen.
There, if I search for navigate, you see, here is our navigation action, I dispatched my act, but
I also navigate we shouldn't navigate anymore.
Despatching is enough because this will set a token, set us to authenticator.
And if we are authenticated, well, then we render the proper navigator.
So if we now save this.
It restarted and you actually can already see that it seemed to have worked, that it seems to have
worked, if I now reload this entire application here, I again am locked in automatically.
Now, if I do log out here, I get an error.
So we should fix that as well.
And for this, let's actually go to our Shop Navigator again and dear to the drawer where we render
that log out button.
Here it is.
And there were despatching those logout action.
Just log out action here in the actions file.
Triggers this action here in the reducer with the logout identifier and there I set my initial state
and that might be the problem here.
Let's actually not set it like this, but set the initial state, but set dich, try or log to true.
We didn't really try it, but since we locked out deliberately, we know that trying it won't make any
sense.
Right, because we can't log in automatically.
We just locked out.
So let's save this.
And wait for it just to reload.
And let's give it another try, let's try logging in here.
That works.
And let's try logging out.
And we're getting that regarding the will focus remove function, which is not a function and in the
product overview screen.
Indeed, I am checking whether this screen is getting focused or not.
And I removed this subscription.
Now, for one, there is no will focus event anymore, there's just focus and blur, there is no will
focus and focus will blur, did blur, just focus and blur.
So here we want focus.
In addition, will we get back?
Is now not a subscription where we have to call remove, but instead of function itself, the unsubscribe
function you could say, which you just have to execute to clear that subscription.
And with that, we're done if we now save this.
And we reload this application.
If I click on logout.
I'm locked out, and if I try to lock back in here.
This also works, so this is all working fine now.
Now we can also go to the cart, as you see, we can go to the pages and oh no, we can't.
If I tried to go to orders, I get an error.
That, however, is a problem related to a problem with fixed early already in the options down there.
I set that header left and so on.
D need to be functions.
Let's turn this into a function and Wall Street where we can already scan the other files.
Product detail cart that's looking good.
Added product here header.
Right should become a function header left does not exist here.
User products screen header left should be a function, had to write should be a function and on the
off screen we have no options here which need to function.
So that's working.
If we now safeties again and reload this page here, we should be able to go to the orders and to the
admin screen and dear, also to the ad screen.
And now we get another error.
Naft ID get Perram.
It's not a function and I mentioned this earlier.
When it comes to Perm's, some things changed a bit.
So let's see what changed here and how we now use Perrin's and how we now don't need this strange work
around here anymore to abuse parents to set stuff in our header.