1 00:00:00,950 --> 00:00:05,390 In the last section we were able to determine our users current location just to show you something 2 00:00:05,390 --> 00:00:06,770 interesting really quick. 3 00:00:06,830 --> 00:00:12,140 I want you to recall that as the second argument to that get current position function we put an air 4 00:00:12,140 --> 00:00:13,260 callback. 5 00:00:13,280 --> 00:00:18,110 So one thing that we really want to test as we develop the supplication is to make sure that we have 6 00:00:18,110 --> 00:00:20,710 a good understanding of what happens in the app. 7 00:00:20,750 --> 00:00:27,230 If for some reason the geolocation call fails Now one reason that might cause that call to fail is if 8 00:00:27,230 --> 00:00:32,300 the user declines or does not allow their position to be shared with our app. 9 00:00:32,360 --> 00:00:37,940 I don't know about you but any time that any single web site in the world asked me for my location I 10 00:00:38,000 --> 00:00:39,270 always decline it. 11 00:00:39,270 --> 00:00:43,220 I was denied entirely unless I definitely want to have it share. 12 00:00:43,240 --> 00:00:46,020 But vast majority time I always deny it. 13 00:00:46,130 --> 00:00:52,940 So we're going to make sure that we develop our application to work even if a user declines that request 14 00:00:53,000 --> 00:00:54,950 to share their location. 15 00:00:54,960 --> 00:00:59,460 Now in order to test that flow to make sure that you and I understand what happens inside of our application 16 00:00:59,460 --> 00:01:05,040 when it gets denied we need to to kind of reset our permissions very easily to make sure that we get 17 00:01:05,040 --> 00:01:10,810 that allow or deny a pop up to appear on our screen again because as you might notice every time you 18 00:01:10,810 --> 00:01:15,330 refreshed this page after allowing At one time you're never going to get asked again. 19 00:01:15,660 --> 00:01:20,620 So in order to get asked again all you got to do is find this little guy next to our address. 20 00:01:20,730 --> 00:01:23,840 You'll notice that we get this dropdown and it says location. 21 00:01:23,910 --> 00:01:25,860 We are always allowing. 22 00:01:25,980 --> 00:01:31,020 So in order to test our application and make sure that it still works correctly even if we deny the 23 00:01:31,020 --> 00:01:38,910 location request I can reset this to ask default like so and then I can refresh the page and then I'm 24 00:01:38,910 --> 00:01:45,180 back to square one where I get asked if I'm going to allow localhost thousand to know my location. 25 00:01:45,180 --> 00:01:51,350 So this time around I go ahead and hit block and then you'll see that we get this position air object 26 00:01:51,740 --> 00:01:56,590 that gives us some reason to tell us exactly why the geo location failed. 27 00:01:56,780 --> 00:02:01,190 It's like I said we're going to be using this a little bit as we go on throughout this application to 28 00:02:01,190 --> 00:02:05,580 make sure that the app still has a reasonable degree of functionality. 29 00:02:05,660 --> 00:02:11,220 If for some reason we are not able to get the user's location Now one thing to keep in mind is that 30 00:02:11,250 --> 00:02:14,620 if I now refresh the page again it's still going to be blocked. 31 00:02:14,790 --> 00:02:20,340 So in practice you and I as we go to this application we're going to be using this dropdown many many 32 00:02:20,340 --> 00:02:23,310 times to test out the entire flow of our application. 33 00:02:24,420 --> 00:02:24,740 OK. 34 00:02:24,800 --> 00:02:28,560 So now that we have a really good idea of how this geolocation stuff works. 35 00:02:28,610 --> 00:02:32,540 One more quick pause then we'll come back and write some more code into our app component.