LANCommander/LANCommander.Launcher/UI/Components/ReportIssueDialog.razor
Pat Hartl 698a7523b6 Code cleanup
- Move all Launcher components to LANCommander.Launcher.UI namespace
- Move all SCSS files next to components (when possible)
- Refactor styles that control overflow of content into titlebar to MainWindow only
- Remove use in launcher UI of SDK.Client
2025-12-31 20:01:04 -06:00

42 lines
1.2 KiB
Text

@inherits FeedbackComponent<Data.Models.Game, SDK.Models.Issue>
@inject IssueClient IssueClient
@inject IMessageService MessageService
@inject LocalizationService LocalizationService
<Form Model="Issue">
<FormItem Style="margin-bottom: 0">
<TextArea @bind-Value="@context.Description" MinRows="10" />
</FormItem>
</Form>
@code {
SDK.Models.Issue Issue { get; set; } = new();
public override async Task OnFeedbackOkAsync(ModalClosingEventArgs args)
{
try {
Issue.GameId = Options.Id;
var success = await IssueClient.Open(Issue.Description, Issue.GameId);
if (success)
{
MessageService.Success(LocalizationService.GetString("IssueReported"));
await base.FeedbackRef.CloseAsync();
}
else
{
MessageService.Error(LocalizationService.GetString("UnknownErrorIssueNotReported"));
args.Reject();
}
}
catch (Exception ex)
{
MessageService.Error(LocalizationService.GetString("UnknownErrorIssueNotReported"));
args.Reject();
}
}
}