<commit_before>﻿using System.Windows;
using GalaSoft.MvvmLight.Messaging;
using GalaSoft.MvvmLight.Threading;
using Microsoft.Phone.Controls;
using TodotxtTouch.WindowsPhone.Messages;
using TodotxtTouch.WindowsPhone.ViewModel;

namespace TodotxtTouch.WindowsPhone
{
	public partial class DropboxLogin : PhoneApplicationPage
	{
		public DropboxLogin()
		{
			InitializeComponent();

            Messenger.Default.Register<CredentialsUpdatedMessage>(this, msg =>
                                                                            {
                                                                                if(NavigationService.CanGoBack)
                                                                                {
                                                                                    NavigationService.GoBack();
                                                                                }
                                                                            });

			Messenger.Default.Register<RetrievedDropboxTokenMessage>(this, LoadLoginPage);

			loginBrowser.LoadCompleted += LoadCompleted;
		}

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            ((DropboxCredentialsViewModel)DataContext).StartLoginProcessCommand.Execute(null);
        }

		private void LoadLoginPage(RetrievedDropboxTokenMessage msg)
		{
			if(!string.IsNullOrEmpty(msg.Error))
			{
				DispatcherHelper.CheckBeginInvokeOnUI(() => MessageBox.Show(msg.Error));
			}
			else
			{
				loginBrowser.Navigate(msg.TokenUri);	
			}
		}

		private void LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
		{
			//Check for the callback path here (or just check it against "/1/oauth/authorize")
			if (e.Uri.Host == "todotxt.traceur-llc.com")
			{
				Messenger.Default.Send(new DropboxLoginSuccessfulMessage());
			}
		}
	}
}<commit_msg>Update oauth completion URI<commit_after>﻿using System.Windows;
using GalaSoft.MvvmLight.Messaging;
using GalaSoft.MvvmLight.Threading;
using Microsoft.Phone.Controls;
using TodotxtTouch.WindowsPhone.Messages;
using TodotxtTouch.WindowsPhone.ViewModel;

namespace TodotxtTouch.WindowsPhone
{
	public partial class DropboxLogin : PhoneApplicationPage
	{
		public DropboxLogin()
		{
			InitializeComponent();

            Messenger.Default.Register<CredentialsUpdatedMessage>(this, msg =>
                                                                            {
                                                                                if(NavigationService.CanGoBack)
                                                                                {
                                                                                    NavigationService.GoBack();
                                                                                }
                                                                            });

			Messenger.Default.Register<RetrievedDropboxTokenMessage>(this, LoadLoginPage);

			loginBrowser.LoadCompleted += LoadCompleted;
		}

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            ((DropboxCredentialsViewModel)DataContext).StartLoginProcessCommand.Execute(null);
        }

		private void LoadLoginPage(RetrievedDropboxTokenMessage msg)
		{
			if(!string.IsNullOrEmpty(msg.Error))
			{
				DispatcherHelper.CheckBeginInvokeOnUI(() => MessageBox.Show(msg.Error));
			}
			else
			{
				loginBrowser.Navigate(msg.TokenUri);	
			}
		}

		private void LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
		{
			//Check for the callback path here (or just check it against "/1/oauth/authorize")
			if (e.Uri.Host == "todotxt.codewise-llc.com")
			{
				Messenger.Default.Send(new DropboxLoginSuccessfulMessage());
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.07868852459016394, 'fraction_numerical': 0.0005044136191677175, 'mean_word_length': 1.6092105263157894, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6638071', 'n_tokens_mistral': 1001, 'n_tokens_neox': 887, 'n_words': 141}