Correction de l'acces a la page chrono
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
|| string.Equals(currentPath, "chrono.html", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(currentPath, "cube", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(currentPath, "cube.html", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(currentPath, "application", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(currentPath, "application.html", StringComparison.OrdinalIgnoreCase)
|
||||
|| currentPath.StartsWith("authentication/", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form class="setup-form" @onsubmit="HandleSubmit">
|
||||
<form class="setup-form" @onsubmit="HandleSubmit" @onsubmit:preventDefault="true" novalidate>
|
||||
<label class="option-card competition-option span-2 @(Form.CompetitionMode ? "is-selected" : string.Empty)">
|
||||
<input @bind="Form.CompetitionMode" id="competitionMode" name="competitionMode" type="checkbox" />
|
||||
<strong>Mode competition</strong>
|
||||
@@ -174,7 +174,7 @@
|
||||
</div>
|
||||
|
||||
<div class="setup-actions span-2">
|
||||
<button class="button primary" type="submit">Ouvrir la page chrono</button>
|
||||
<button class="button primary" type="button" @onclick="HandleSubmit">Ouvrir la page chrono</button>
|
||||
<button class="button secondary" id="loadDemoButton" type="button" @onclick="LoadDemo">Charger une demo</button>
|
||||
<a class="button ghost" href="reglement.html">Consulter le reglement</a>
|
||||
</div>
|
||||
@@ -300,9 +300,20 @@
|
||||
|
||||
private async Task HandleSubmit()
|
||||
{
|
||||
await Store.EnsureLoadedAsync();
|
||||
var match = MatchEngine.CreateMatch(Form.ToMatchConfig());
|
||||
Store.SetCurrent(match);
|
||||
await Store.SaveAsync();
|
||||
|
||||
try
|
||||
{
|
||||
await Store.SaveAsync();
|
||||
}
|
||||
catch
|
||||
{
|
||||
// La navigation vers la phase chrono doit rester possible meme si la persistence
|
||||
// du navigateur echoue ponctuellement.
|
||||
}
|
||||
|
||||
Navigation.NavigateTo("/chrono.html");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user