forked from khalidabuhakmeh/TiredDoctorManhattan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb0da5f
commit 58c5608
Showing
13 changed files
with
174 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,12 @@ jobs: | |
# uses GitHub's checkout action to checkout code form the main branch | ||
- uses: actions/[email protected] | ||
|
||
- name: UpdateVersionInMainLayout | ||
uses: datamonsters/replace-action@v2 | ||
with: | ||
files: 'TiredDoctorManhattan.Wasm/Pages/Index.razor.cs' | ||
replacements: '%%CACHE_VERSION%%=${{ github.run_id }}' | ||
|
||
# sets up .NET SDK | ||
- name: Setup .NET Core SDK | ||
uses: actions/[email protected] | ||
|
@@ -41,6 +47,12 @@ jobs: | |
- name: Add .nojekyll file | ||
run: touch release/wwwroot/.nojekyll | ||
|
||
- name: UpdateVersion | ||
uses: datamonsters/replace-action@v2 | ||
with: | ||
files: 'release/wwwroot/service-worker.published.js' | ||
replacements: '%%CACHE_VERSION%%=${{ github.run_id }}' | ||
|
||
- name: Commit wwwroot to GitHub Pages | ||
uses: JamesIves/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
var builder = WebAssemblyHostBuilder.CreateDefault(args); | ||
var services = builder.Services; | ||
|
||
builder.RootComponents.Add<App>("#app"); | ||
builder.RootComponents.Add<HeadOutlet>("head::after"); | ||
|
||
builder.Services.AddScoped(_ => new HttpClient | ||
{ | ||
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) | ||
}); | ||
services | ||
.AddSingleton(_ => new HttpClient | ||
{ | ||
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) | ||
}) | ||
.AddSingleton<IUpdateAlertService, UpdateAlertService>(); | ||
|
||
await builder.Build().RunAsync(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace TiredDoctorManhattan.Wasm.Services; | ||
|
||
public interface IUpdateAlertService | ||
{ | ||
event Action? OnUpdateAvailable; | ||
|
||
void ShowUpdateMessage(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace TiredDoctorManhattan.Wasm.Services; | ||
|
||
public class UpdateAlertService : IUpdateAlertService | ||
{ | ||
public static UpdateAlertService? Instance { get; private set; } | ||
|
||
public event Action? OnUpdateAvailable; | ||
|
||
public UpdateAlertService() => Instance = this; | ||
|
||
void IUpdateAlertService.ShowUpdateMessage() => ShowUpdateMessage(); | ||
|
||
[JSInvokable(nameof(ShowUpdateMessage))] | ||
public static void ShowUpdateMessage() => Instance?.OnUpdateAvailable?.Invoke(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
TiredDoctorManhattan.Wasm/wwwroot/BrowserNotSupported.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Tired Doctor Manhattan</title> | ||
<link rel="icon" type="image/png" sizes="512x512" href="icon-512.png" /> | ||
<link rel="icon" type="image/png" sizes="192x192" href="icon-192.png" /> | ||
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" /> | ||
<link rel="apple-touch-icon" sizes="192x192" href="icon-192.png" /> | ||
</head> | ||
|
||
<body> | ||
<h1> | ||
Tired Doctor Manhattan | ||
</h1> | ||
|
||
Tired Doctor Manhattan is not supported in the current browser. For a list of compatible browsers, see here: <a href="https://caniuse.com/wasm" target="_blank">https://caniuse.com/wasm</a> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters