Skip to content

Commit b6b6cf9

Browse files
committed
minor improvements
1 parent 62fde7c commit b6b6cf9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Spixi/Pages/Home/HomePage.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private HomePage ()
8686
{
8787
running = true;
8888

89-
Task.Run(() =>
89+
Task.Run(async () =>
9090
{
9191
try
9292
{
@@ -402,9 +402,9 @@ private void onNavigating(object sender, WebNavigatingEventArgs e)
402402
{
403403
Browser.Default.OpenAsync(new Uri(Config.spixiAppsUrl));
404404
}
405-
else
405+
else if (current_url.Trim().StartsWith("file:", StringComparison.OrdinalIgnoreCase))
406406
{
407-
// Otherwise it's just normal navigation
407+
// allow normal navigation only for local files
408408
e.Cancel = false;
409409
return;
410410
}

Spixi/Platforms/iOS/SPowerManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System;
1+
using IXICore.Meta;
2+
using System;
23
using System.Collections.Generic;
34
using System.Linq;
45
using System.Text;
@@ -17,7 +18,7 @@ public static bool AquireLock(string lock_type = "screenDim")
1718
case "screenDim":
1819
MainThread.BeginInvokeOnMainThread(() =>
1920
{
20-
UIApplication.SharedApplication.IdleTimerDisabled = true;
21+
DeviceDisplay.Current.KeepScreenOn = true;
2122
});
2223
return true;
2324
case "partial":
@@ -41,7 +42,7 @@ public static bool ReleaseLock(string lock_type = "screenDim")
4142
case "screenDim":
4243
MainThread.BeginInvokeOnMainThread(() =>
4344
{
44-
UIApplication.SharedApplication.IdleTimerDisabled = false;
45+
DeviceDisplay.Current.KeepScreenOn = false;
4546
});
4647
return true;
4748
case "partial":

Spixi/Utils/SpixiContentPage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private async Task<bool> checkIfPageLoaded()
111111
tcs.TrySetException(ex);
112112
}
113113
});
114-
return (await tcs.Task).Trim('\"') == "complete";
114+
return (await tcs.Task)?.Trim('\"') == "complete";
115115
}
116116

117117
public virtual void reload()

0 commit comments

Comments
 (0)