mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2025-04-18 01:12:22 +03:00
Fix Rider inspections
This commit is contained in:
parent
4cfe19d369
commit
2ec9c7cbc3
@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
@ -21,8 +20,11 @@ namespace DHT.Desktop.Dialogs {
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
|
||||
private void Loaded(object? sender, EventArgs e) {
|
||||
public void OnClosing(object? sender, CancelEventArgs e) {
|
||||
e.Cancel = !isFinished;
|
||||
}
|
||||
|
||||
public void Loaded(object? sender, EventArgs e) {
|
||||
if (DataContext is ProgressDialogModel model) {
|
||||
Task.Run(model.StartTask).ContinueWith(OnFinished, TaskScheduler.FromCurrentSynchronizationContext());
|
||||
}
|
||||
@ -32,10 +34,5 @@ namespace DHT.Desktop.Dialogs {
|
||||
isFinished = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
|
||||
private void OnClosing(object? sender, CancelEventArgs e) {
|
||||
e.Cancel = !isFinished;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ namespace DHT.Desktop.Main.Pages {
|
||||
fileDialog.Directory = Path.GetDirectoryName(Db.Path);
|
||||
fileDialog.AllowMultiple = true;
|
||||
|
||||
string[] paths = await fileDialog.ShowAsync(window);
|
||||
string[]? paths = await fileDialog.ShowAsync(window);
|
||||
if (paths == null || paths.Length == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -97,7 +97,8 @@ namespace DHT.Desktop.Main.Pages {
|
||||
int counter = 0;
|
||||
|
||||
while (File.Exists(fullPath)) {
|
||||
fullPath = Path.Combine(rootPath, filenameBase + "-" + (++counter) + ".html");
|
||||
++counter;
|
||||
fullPath = Path.Combine(rootPath, filenameBase + "-" + counter + ".html");
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(rootPath);
|
||||
@ -119,7 +120,7 @@ namespace DHT.Desktop.Main.Pages {
|
||||
}
|
||||
}.ShowAsync(window);
|
||||
|
||||
string path = await dialog;
|
||||
string? path = await dialog;
|
||||
if (!string.IsNullOrEmpty(path)) {
|
||||
await File.WriteAllTextAsync(path, await GenerateViewerContents());
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace DHT.Desktop.Main {
|
||||
var dialog = DatabaseGui.NewOpenOrCreateDatabaseFileDialog();
|
||||
dialog.Directory = Path.GetDirectoryName(dbFilePath);
|
||||
|
||||
string path = await dialog.ShowAsync(window);
|
||||
string? path = await dialog.ShowAsync(window);
|
||||
if (!string.IsNullOrWhiteSpace(path)) {
|
||||
await OpenOrCreateDatabaseFromPath(path);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ namespace DHT.Server.Database.Sqlite {
|
||||
if (filter.StartDate != null) {
|
||||
conditions.Add("timestamp >= " + new DateTimeOffset(filter.StartDate.Value).ToUnixTimeMilliseconds());
|
||||
}
|
||||
|
||||
if (filter.EndDate != null) {
|
||||
conditions.Add("timestamp <= " + new DateTimeOffset(filter.EndDate.Value).ToUnixTimeMilliseconds());
|
||||
}
|
||||
|
@ -22,8 +22,8 @@ namespace DHT.Server.Endpoints {
|
||||
throw new HttpException(HttpStatusCode.BadRequest, "Expected root element to be an array.");
|
||||
}
|
||||
|
||||
MessageFilter addedMessageIdFilter = new();
|
||||
Message[] messages = new Message[root.GetArrayLength()];
|
||||
var addedMessageIdFilter = new MessageFilter();
|
||||
var messages = new Message[root.GetArrayLength()];
|
||||
|
||||
int i = 0;
|
||||
foreach (JsonElement ele in root.EnumerateArray()) {
|
||||
|
@ -18,7 +18,7 @@ namespace DHT.Server.Endpoints {
|
||||
throw new HttpException(HttpStatusCode.BadRequest, "Expected root element to be an array.");
|
||||
}
|
||||
|
||||
User[] users = new User[root.GetArrayLength()];
|
||||
var users = new User[root.GetArrayLength()];
|
||||
int i = 0;
|
||||
|
||||
foreach (JsonElement user in root.EnumerateArray()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user