|
1 | 1 | @using System.ComponentModel |
2 | 2 | @using Humanizer |
3 | 3 | @inject MessageLog messageLog |
4 | | -@inject GameWatcher eft |
5 | 4 | @inject LocalizationService LocalizationService |
6 | 5 |
|
7 | 6 | <MudDialog> |
|
38 | 37 | </DialogContent> |
39 | 38 | <DialogActions> |
40 | 39 | <MudButton OnClick="Cancel">@LocalizationService.GetString("Cancel")</MudButton> |
41 | | - <MudButton Color="Color.Primary" OnClick="Submit">@LocalizationService.GetString("Ok")</MudButton> |
| 40 | + <MudButton Color="Color.Primary" OnClick="Submit" Disabled="@SubmitDisabled">@LocalizationService.GetString("Ok")</MudButton> |
42 | 41 | </DialogActions> |
43 | 42 | </MudDialog> |
44 | 43 | @code { |
45 | 44 | [CascadingParameter] MudDialogInstance MudDialog { get; set; } |
46 | 45 |
|
47 | 46 | internal GameWatcher customWatcher = new(); |
48 | | - LogDetails? selectedBreakpoint; |
| 47 | + LogDetails? _selectedBreakpoint; |
| 48 | + LogDetails? selectedBreakpoint { |
| 49 | + get |
| 50 | + { |
| 51 | + return _selectedBreakpoint; |
| 52 | + } |
| 53 | + set |
| 54 | + { |
| 55 | + SubmitDisabled = value == null; |
| 56 | + _selectedBreakpoint = value; |
| 57 | + } |
| 58 | + } |
49 | 59 | List<LogDetails>? breakpoints; |
50 | 60 | Dictionary<string, TarkovMonitor.TaskStatus> TaskStatuses = new(); |
| 61 | + bool SubmitDisabled { get; set; } = true; |
51 | 62 |
|
52 | 63 | protected override void OnInitialized() |
53 | 64 | { |
|
83 | 94 | { |
84 | 95 | messageLog.AddMessage("You must have a valid Tarkov Tracker API token to read past logs.", "exception"); |
85 | 96 | } |
| 97 | + SubmitDisabled = true; |
| 98 | + GameWatcher.ReadingPastLogs = true; |
86 | 99 | TaskStatuses.Clear(); |
87 | 100 | Dictionary<string, TarkovMonitor.TaskStatus> updateTasks = new(); |
88 | 101 | try |
|
129 | 142 | } |
130 | 143 | catch (Exception ex) |
131 | 144 | { |
132 | | - messageLog.AddMessage($"Error finding task updates: {ex.Message}", "exception"); |
| 145 | + messageLog.AddMessage($"Error compiling task updates: {ex.Message}", "exception"); |
133 | 146 | return; |
134 | 147 | } |
| 148 | + finally |
| 149 | + { |
| 150 | + GameWatcher.ReadingPastLogs = false; |
| 151 | + } |
135 | 152 | try |
136 | 153 | { |
137 | 154 | if (updateTasks.Count > 0) |
|
0 commit comments