Save
This commit is contained in:
1 parent
ba4a4b14c8
commit
5cba76554a
84 files changed
+18148
-11553
No files matched your search
@@ -1,6 +1,54 @@
|
||||
namespace decePubClient.Services;
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace decePubClient.Services;
|
||||
|
||||
public class AppStatusService
|
||||
{
|
||||
|
||||
readonly IJSRuntime JsRuntime;
|
||||
readonly IJSInProcessRuntime JsSyncRuntime;
|
||||
|
||||
public AppStatusService(IJSRuntime JSRuntime)
|
||||
{
|
||||
JsRuntime = JSRuntime;
|
||||
JsSyncRuntime = (IJSInProcessRuntime)JSRuntime;
|
||||
}
|
||||
|
||||
public async ValueTask<bool> IsOnline() => await JsSyncRuntime.InvokeAsync<bool>("isOnline");
|
||||
|
||||
public bool InputCaptureSupported() => JsSyncRuntime.Invoke<bool>("inputCaptureSupported");
|
||||
|
||||
public bool IsServiceWorkerAvailable() => JsSyncRuntime.Invoke<bool>("isServiceWorkerAvailable");
|
||||
|
||||
public string Language() => JsSyncRuntime.Invoke<string>("getLanguage");
|
||||
|
||||
public void Language(string language) => JsSyncRuntime.InvokeVoid("setLanguage", language);
|
||||
|
||||
public long GetHeight(string classId) => JsSyncRuntime.Invoke<long>("getHeight", classId);
|
||||
|
||||
public void SetAppBadge(int counter) => JsSyncRuntime.InvokeVoid("setAppBadge", counter);
|
||||
|
||||
public void ClearAppBadge() => JsSyncRuntime.InvokeVoid("clearAppBadge");
|
||||
|
||||
public async ValueTask ClearCache()
|
||||
{
|
||||
await JsRuntime.InvokeVoidAsync("clearCache");
|
||||
}
|
||||
|
||||
public async ValueTask ClearLocalStorage()
|
||||
{
|
||||
await JsRuntime.InvokeVoidAsync("clearLocalStorage");
|
||||
}
|
||||
|
||||
public void ReloadPage()
|
||||
{
|
||||
JsSyncRuntime.InvokeVoid("reloadPage");
|
||||
}
|
||||
|
||||
public bool IsMobileMedia() => JsSyncRuntime.Invoke<bool>("isMobileMedia");
|
||||
|
||||
public bool CanShare() => JsSyncRuntime.Invoke<bool>("canShareStuff");
|
||||
|
||||
public async ValueTask ShareTextUrl(string title, string text, Uri uri) => await JsRuntime.InvokeVoidAsync("shareTextUrl", title, text, uri.ToString());
|
||||
|
||||
public async ValueTask ShareText(string title, string text) => await JsRuntime.InvokeVoidAsync("shareText", title, text);
|
||||
}
|
||||
Reference in new issue
Block a user