1 00:00:01,310 --> 00:00:04,700 Well we finally got through all that use location stuff which is fantastic. 2 00:00:04,700 --> 00:00:06,890 One last very quick thing I want to go through. 3 00:00:06,890 --> 00:00:12,320 Remember we had said that whenever a user comes to the screen and navigates away we should disable location 4 00:00:12,320 --> 00:00:17,130 tracking and at present we are doing that inside of track create screen through the use that is focused 5 00:00:17,160 --> 00:00:18,320 flag. 6 00:00:18,350 --> 00:00:23,960 However we also said that once a user starts recording and then navigates away we still want to record 7 00:00:24,620 --> 00:00:25,190 at present. 8 00:00:25,190 --> 00:00:29,420 If I tap on START RECORDING right here and then go back over to my terminal. 9 00:00:29,660 --> 00:00:35,750 Definitely recording but if I navigate away the recording process stops and I can tell that because 10 00:00:35,750 --> 00:00:40,490 the number five essentially just stops I don't see it anymore console logs inside here. 11 00:00:40,490 --> 00:00:42,200 So how are we going to fix this. 12 00:00:42,200 --> 00:00:45,600 Well it's not really going to be that bad back inside of track create screen. 13 00:00:45,650 --> 00:00:46,570 Remember we've got the. 14 00:00:46,570 --> 00:00:47,460 Is focused. 15 00:00:47,470 --> 00:00:53,090 Flag right here that we're passing in as the first argument use location uses that first argument to 16 00:00:53,090 --> 00:00:55,910 decide whether or not to start or stop tracking. 17 00:00:56,510 --> 00:01:01,160 So if you want to modify whether or not we are tracking we can essentially append on some additional 18 00:01:01,250 --> 00:01:02,460 value here. 19 00:01:02,480 --> 00:01:09,080 So in other words we can say something like is focused or if we are currently recording. 20 00:01:09,110 --> 00:01:14,150 So if we are currently focused on the screen or if we are recording we want to continue tracking our 21 00:01:14,150 --> 00:01:22,370 users location so we can save this and then test out again so if I go back over I now am recording if 22 00:01:22,370 --> 00:01:26,430 I go to track list screen the console log stop. 23 00:01:26,440 --> 00:01:32,670 So clearly I'm no longer recording but if I go back over once again and start recording and then navigate 24 00:01:32,670 --> 00:01:38,730 away it continues on until I go back to that screen once more hit stop. 25 00:01:38,730 --> 00:01:40,580 And now it's back to original. 26 00:01:40,580 --> 00:01:45,280 So I mean navigate away and now it's back to original where no more console logs. 27 00:01:45,330 --> 00:01:49,300 So pretty easy know back inside of track create screen. 28 00:01:49,300 --> 00:01:53,490 One thing only mentioned very quickly is that we've got three references to state DOT recording. 29 00:01:53,920 --> 00:01:58,000 So just to condense our code a little bit we might decide to D structure off that recording property 30 00:01:58,260 --> 00:02:05,550 off of our state variable so we could say colon recording like so now we can go round and change each 31 00:02:05,560 --> 00:02:11,740 these two just recording recording and recording. 32 00:02:11,850 --> 00:02:12,990 Very good. 33 00:02:12,990 --> 00:02:13,220 All right. 34 00:02:13,230 --> 00:02:15,110 That's one more little step forward. 35 00:02:15,120 --> 00:02:17,390 Let's take another pause and continue in just a moment.