mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
More default entries UX
This commit is contained in:
1 parent
7c435fb037
commit
adbf850bff
12 files changed
+103
-34
No files matched your search
@@ -54,9 +54,10 @@ public interface IWorkshopService
|
||||
/// <summary>
|
||||
/// Validates the status of the workshop.
|
||||
/// </summary>
|
||||
/// <param name="navigateIfUnreachable">Whether to navigate to the offline page if the workshop is unreachable.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>A boolean indicating whether the workshop is reachable.</returns>
|
||||
Task<bool> ValidateWorkshopStatus(CancellationToken cancellationToken);
|
||||
Task<bool> ValidateWorkshopStatus(bool navigateIfUnreachable, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Navigates to a specific entry.
|
||||
|
||||
@@ -130,10 +130,10 @@ public class WorkshopService : IWorkshopService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> ValidateWorkshopStatus(CancellationToken cancellationToken)
|
||||
public async Task<bool> ValidateWorkshopStatus(bool navigateIfUnreachable, CancellationToken cancellationToken)
|
||||
{
|
||||
IWorkshopService.WorkshopStatus status = await GetWorkshopStatus(cancellationToken);
|
||||
if (!status.IsReachable && !cancellationToken.IsCancellationRequested)
|
||||
if (navigateIfUnreachable && !status.IsReachable && !cancellationToken.IsCancellationRequested)
|
||||
await _router.Navigate($"workshop/offline/{status.Message}");
|
||||
return status.IsReachable;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user