1 00:00:02,280 --> 00:00:04,590 So why are we getting this error here? 2 00:00:05,460 --> 00:00:10,390 Well, we're trying to navigate to a root or to a screen named shop now. 3 00:00:10,410 --> 00:00:16,350 We had that in the past year and our switch navigator there, we had the shop screen. 4 00:00:16,770 --> 00:00:23,220 But now we have a different logic for rendering this navigator and all the screens and sub navigators 5 00:00:23,220 --> 00:00:24,110 that belong to it. 6 00:00:25,080 --> 00:00:29,250 So let's actually go to the place where we triggered this navigation action. 7 00:00:30,100 --> 00:00:31,990 And that's actually on the off screen. 8 00:00:33,360 --> 00:00:39,210 There, if I search for navigate, you see, here is our navigation action, I dispatched my act, but 9 00:00:39,210 --> 00:00:42,200 I also navigate we shouldn't navigate anymore. 10 00:00:42,330 --> 00:00:46,830 Despatching is enough because this will set a token, set us to authenticator. 11 00:00:46,830 --> 00:00:51,480 And if we are authenticated, well, then we render the proper navigator. 12 00:00:52,140 --> 00:00:53,580 So if we now save this. 13 00:00:56,800 --> 00:01:02,770 It restarted and you actually can already see that it seemed to have worked, that it seems to have 14 00:01:02,770 --> 00:01:09,270 worked, if I now reload this entire application here, I again am locked in automatically. 15 00:01:09,310 --> 00:01:12,100 Now, if I do log out here, I get an error. 16 00:01:12,490 --> 00:01:13,980 So we should fix that as well. 17 00:01:14,530 --> 00:01:22,420 And for this, let's actually go to our Shop Navigator again and dear to the drawer where we render 18 00:01:22,420 --> 00:01:23,470 that log out button. 19 00:01:27,250 --> 00:01:27,940 Here it is. 20 00:01:29,150 --> 00:01:31,730 And there were despatching those logout action. 21 00:01:34,950 --> 00:01:39,390 Just log out action here in the actions file. 22 00:01:41,000 --> 00:01:47,720 Triggers this action here in the reducer with the logout identifier and there I set my initial state 23 00:01:48,530 --> 00:01:50,160 and that might be the problem here. 24 00:01:50,720 --> 00:01:57,580 Let's actually not set it like this, but set the initial state, but set dich, try or log to true. 25 00:01:57,590 --> 00:02:03,530 We didn't really try it, but since we locked out deliberately, we know that trying it won't make any 26 00:02:03,530 --> 00:02:04,010 sense. 27 00:02:04,220 --> 00:02:07,120 Right, because we can't log in automatically. 28 00:02:07,130 --> 00:02:08,170 We just locked out. 29 00:02:08,900 --> 00:02:10,040 So let's save this. 30 00:02:12,490 --> 00:02:14,050 And wait for it just to reload. 31 00:02:16,740 --> 00:02:19,800 And let's give it another try, let's try logging in here. 32 00:02:25,090 --> 00:02:25,960 That works. 33 00:02:27,150 --> 00:02:28,890 And let's try logging out. 34 00:02:30,350 --> 00:02:36,260 And we're getting that regarding the will focus remove function, which is not a function and in the 35 00:02:36,260 --> 00:02:37,650 product overview screen. 36 00:02:37,910 --> 00:02:42,860 Indeed, I am checking whether this screen is getting focused or not. 37 00:02:42,860 --> 00:02:44,870 And I removed this subscription. 38 00:02:45,750 --> 00:02:51,060 Now, for one, there is no will focus event anymore, there's just focus and blur, there is no will 39 00:02:51,060 --> 00:02:54,930 focus and focus will blur, did blur, just focus and blur. 40 00:02:54,990 --> 00:02:56,250 So here we want focus. 41 00:02:56,910 --> 00:02:58,200 In addition, will we get back? 42 00:02:58,200 --> 00:03:05,100 Is now not a subscription where we have to call remove, but instead of function itself, the unsubscribe 43 00:03:05,190 --> 00:03:10,610 function you could say, which you just have to execute to clear that subscription. 44 00:03:11,460 --> 00:03:13,950 And with that, we're done if we now save this. 45 00:03:17,000 --> 00:03:18,800 And we reload this application. 46 00:03:22,190 --> 00:03:23,990 If I click on logout. 47 00:03:24,900 --> 00:03:29,280 I'm locked out, and if I try to lock back in here. 48 00:03:32,270 --> 00:03:35,580 This also works, so this is all working fine now. 49 00:03:35,900 --> 00:03:41,510 Now we can also go to the cart, as you see, we can go to the pages and oh no, we can't. 50 00:03:42,260 --> 00:03:44,420 If I tried to go to orders, I get an error. 51 00:03:44,720 --> 00:03:50,570 That, however, is a problem related to a problem with fixed early already in the options down there. 52 00:03:50,870 --> 00:03:52,790 I set that header left and so on. 53 00:03:52,910 --> 00:03:54,200 D need to be functions. 54 00:03:54,260 --> 00:03:59,180 Let's turn this into a function and Wall Street where we can already scan the other files. 55 00:03:59,180 --> 00:04:02,660 Product detail cart that's looking good. 56 00:04:03,200 --> 00:04:04,850 Added product here header. 57 00:04:04,850 --> 00:04:08,960 Right should become a function header left does not exist here. 58 00:04:09,380 --> 00:04:15,680 User products screen header left should be a function, had to write should be a function and on the 59 00:04:15,680 --> 00:04:20,480 off screen we have no options here which need to function. 60 00:04:20,810 --> 00:04:21,530 So that's working. 61 00:04:21,530 --> 00:04:29,390 If we now safeties again and reload this page here, we should be able to go to the orders and to the 62 00:04:29,390 --> 00:04:33,560 admin screen and dear, also to the ad screen. 63 00:04:33,920 --> 00:04:35,330 And now we get another error. 64 00:04:35,450 --> 00:04:37,310 Naft ID get Perram. 65 00:04:37,310 --> 00:04:39,230 It's not a function and I mentioned this earlier. 66 00:04:39,710 --> 00:04:43,040 When it comes to Perm's, some things changed a bit. 67 00:04:43,430 --> 00:04:50,630 So let's see what changed here and how we now use Perrin's and how we now don't need this strange work 68 00:04:50,630 --> 00:04:55,370 around here anymore to abuse parents to set stuff in our header.