<commit_before>﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Diagnostics;
using StyrClient.Network;

namespace StyrClient
{

	public class MainRemotePage : ContentPage
	{
		private RemoteSession remoteSession;
		private bool keyboardWasHidden;

		private Image keyboardButton;
		private KeyboardEditor keyboardEditor;

		public MainRemotePage(IPEndPoint ep)
		{
			keyboardWasHidden = false;
			remoteSession = new RemoteSession (ep);

			remoteSession.Timeout += () => {
				Device.BeginInvokeOnMainThread( () => {
					DisplayAlert("Connection error", "Remote server has stopped responding", "OK");
					Console.WriteLine("Server has stopped responding");
					Navigation.PopAsync();			
				});
			};

			((App)App.Current).Sleep += OnAppSleep;
			((App)App.Current).Resume += OnAppResume;

			BuildPageGUI ();
		}<commit_msg>Fix: iOS required Navigation pop to happen before DisplayAlert<commit_after>﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using Xamarin.Forms;
using System.Diagnostics;
using StyrClient.Network;

namespace StyrClient
{

	public class MainRemotePage : ContentPage
	{
		private RemoteSession remoteSession;
		private bool keyboardWasHidden;

		private Image keyboardButton;
		private KeyboardEditor keyboardEditor;

		public MainRemotePage(IPEndPoint ep)
		{
			keyboardWasHidden = false;
			remoteSession = new RemoteSession (ep);

			remoteSession.Timeout += () => {
				Device.BeginInvokeOnMainThread( () => {
					Console.WriteLine("Server has stopped responding");
					Navigation.PopAsync();
					DisplayAlert("Connection error", "Remote server has stopped responding", "OK");
				});
			};

			((App)App.Current).Sleep += OnAppSleep;
			((App)App.Current).Resume += OnAppResume;

			BuildPageGUI ();
		}
{'fraction_non_alphanumeric': 0.10550935550935552, 'fraction_numerical': 0.0, 'mean_word_length': 4.59593023255814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1977525', 'n_tokens_mistral': 627, 'n_tokens_neox': 532, 'n_words': 134}