Browse Source

Fix DialogErrorHandler interface defaults

pull/5/head
Ionite 1 year ago
parent
commit
cdc2ffd149
No known key found for this signature in database
  1. 2
      StabilityMatrix/Helper/DialogErrorHandler.cs
  2. 4
      StabilityMatrix/Helper/IDialogErrorHandler.cs

2
StabilityMatrix/Helper/DialogErrorHandler.cs

@ -38,7 +38,7 @@ public class DialogErrorHandler : IDialogErrorHandler
LogLevel.Information => ControlAppearance.Info,
_ => ControlAppearance.Secondary
};
// snackbarService.Timeout = timeoutMilliseconds;
snackbarService.Timeout = timeoutMilliseconds;
var icon = new SymbolIcon(SymbolRegular.ErrorCircle24);
snackbarService.ShowAsync("Error", message, icon, snackbarViewModel.SnackbarAppearance);
}

4
StabilityMatrix/Helper/IDialogErrorHandler.cs

@ -9,10 +9,10 @@ public interface IDialogErrorHandler
/// <summary>
/// Shows a generic error snackbar with the given message.
/// </summary>
void ShowSnackbarAsync(string message, LogLevel level = LogLevel.Error, int timeoutSeconds = 5);
void ShowSnackbarAsync(string message, LogLevel level = LogLevel.Error, int timeoutMilliseconds = 5000);
/// <summary>
/// Attempt to run the given action, showing a generic error snackbar if it fails.
/// </summary>
Task<TaskResult<T>> TryAsync<T>(Task<T> task, string message, LogLevel level = LogLevel.Error, int timeoutSeconds = 5);
Task<TaskResult<T>> TryAsync<T>(Task<T> task, string message, LogLevel level = LogLevel.Error, int timeoutMilliseconds = 5000);
}

Loading…
Cancel
Save