Skip to content

Commit 5c041ca

Browse files
committed
fix auto gen and async on initalized
1 parent ce23ccb commit 5c041ca

12 files changed

+19
-15
lines changed

MyDevTools/Components/Pages/BranchNameFormatter.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
private string formattedString = "";
3737
private string copyConfirmationMessage = "";
3838

39-
protected override async void OnInitialized()
39+
protected override async Task OnInitializedAsync()
4040
{
4141
await UpdateMetaTagsAsync("Format a string to be used as a Git branch name.", "Git Branch Name Formatter, Dev Tools, Git Tools");
4242

MyDevTools/Components/Pages/ColorPickerConverter.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
private string selectedColor = "#FFFFFF"; // Default to white
4343
private string convertedColor = "RGB(255, 255, 255)"; // Default to white
4444
45-
protected override async void OnInitialized()
45+
protected override async Task OnInitializedAsync()
4646
{
4747
await UpdateMetaTagsAsync("Convert and choose colours for your projects.", "Colour Converter, Dev Tools, Design");
4848

MyDevTools/Components/Pages/ContainerIds.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"AZLU", "EISU", "BSIU", "NYKU", "YMLU"};
5151

5252

53-
protected override async void OnInitialized()
53+
protected override async Task OnInitializedAsync()
5454
{
5555
await UpdateMetaTagsAsync("Generate container IDs.", "Container IDs, Dev Tools, Identifier");
5656

MyDevTools/Components/Pages/CronGenerator.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@
8686
private string cronExpression = "";
8787
private string copyConfirmationMessage = "";
8888

89-
protected override async void OnInitialized()
89+
protected override async Task OnInitializedAsync()
9090
{
9191
await UpdateMetaTagsAsync("Generate cron expressions with ease.", "Cron Expression Generator, Dev Tools, Web Tools");
9292

9393
base.OnInitialized();
94+
GenerateCronExpression();
9495
}
9596

9697
private void GenerateCronExpression()

MyDevTools/Components/Pages/DiffChecker.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
private string text2 = "";
4141
private SideBySideDiffModel diffModel;
4242

43-
protected override async void OnInitialized()
43+
protected override async Task OnInitializedAsync()
4444
{
4545
await UpdateMetaTagsAsync("Compare code and text to find differences.", "Diff Checker, Dev Tools, Code Comparison");
4646

MyDevTools/Components/Pages/GuidGenerator.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
private int quantity = 1;
5252
private List<string> guidResults = new();
5353

54-
protected override async void OnInitialized()
54+
protected override async Task OnInitializedAsync()
5555
{
5656
await UpdateMetaTagsAsync("Generate GUIDs with ease.", "GUID Generator, Dev Tools, Identifier");
5757

MyDevTools/Components/Pages/HashGenerator.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
private HashAlgorithms selectedAlgorithm = HashAlgorithms.SHA256;
5353
private string hashResult = "";
5454

55-
protected override async void OnInitialized()
55+
protected override async Task OnInitializedAsync()
5656
{
5757
await UpdateMetaTagsAsync("Generate various types of hashes.", "Hash Generator, Dev Tools, Security");
5858

MyDevTools/Components/Pages/JwtDecoder.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
private string inputToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.S5CmpIhks5H_I8HWiRgEzhuHRCXLzguG6zGZtRjG5oA";
3737
private string decodedJson = "";
3838

39-
protected override async void OnInitialized()
39+
protected override async Task OnInitializedAsync()
4040
{
4141
await UpdateMetaTagsAsync("Decode JWTs.", "JWT Decoder, Dev Tools, Web Tools");
4242

MyDevTools/Components/Pages/QrCodeGen.razor

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@inherits Base.BasePage
33
@using Net.Codecrete.QrCodeGenerator
44
@using System.Security.Cryptography
5+
@inject NavigationManager NavigationManager
56

67
<h3 class="text-center">QR Code Generator</h3>
78

@@ -33,11 +34,13 @@
3334
public string QRCodeText { get; set; }
3435
public string QRCodeSvg { get; set; }
3536

36-
protected override void OnInitialized()
37+
protected override async Task OnInitializedAsync()
3738
{
38-
UpdateMetaTagsAsync("Generate QR codes with ease.", "QR Code Generator, Dev Tools, Web Tools");
39-
4039
base.OnInitialized();
40+
await UpdateMetaTagsAsync("Generate QR codes with ease.", "QR Code Generator, Dev Tools, Web Tools");
41+
42+
QRCodeText = NavigationManager.Uri; // Set the QRCodeText to the current URL
43+
GenerateQRCode(); // Automatically generate the QR Code
4144
}
4245

4346
public void GenerateQRCode()

MyDevTools/Components/Pages/RandomNumberGenerator.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
private string generatedNumbersText = "";
4444
private string copyConfirmationMessage = "";
4545

46-
protected override async void OnInitialized()
46+
protected override async Task OnInitializedAsync()
4747
{
4848
await UpdateMetaTagsAsync("Generate random numbers for various purposes.", "Random Numbers, Dev Tools, Math Tools");
4949

0 commit comments

Comments
 (0)