diff --git a/ChatTwo/MessageStore.cs b/ChatTwo/MessageStore.cs index cd05ad2..3dee96c 100644 --- a/ChatTwo/MessageStore.cs +++ b/ChatTwo/MessageStore.cs @@ -724,7 +724,7 @@ internal class MessageStore : IDisposable cmd.Parameters.AddWithValue("$After", ((DateTimeOffset) after).ToUnixTimeMilliseconds()); cmd.Parameters.AddWithValue("$Before", ((DateTimeOffset) before).ToUnixTimeMilliseconds()); cmd.Parameters.AddWithValue("$Offset", DbViewer.RowPerPage * page); - cmd.Parameters.AddWithValue("OffsetCount", DbViewer.RowPerPage); + cmd.Parameters.AddWithValue("$OffsetCount", DbViewer.RowPerPage); return new MessageEnumerator(cmd.ExecuteReader()); } diff --git a/ChatTwo/Ui/DbViewer.cs b/ChatTwo/Ui/DbViewer.cs index e04992e..2304a66 100644 --- a/ChatTwo/Ui/DbViewer.cs +++ b/ChatTwo/Ui/DbViewer.cs @@ -22,7 +22,7 @@ namespace ChatTwo.Ui; public class DbViewer : Window { - public const float RowPerPage = 1000.0f; + public const int RowPerPage = 1000; private readonly Plugin Plugin; @@ -88,7 +88,7 @@ public class DbViewer : Window public override void Draw() { - var totalPages = (int)Math.Ceiling(Count / RowPerPage); + var totalPages = (int)Math.Ceiling((double)Count / RowPerPage); if (totalPages < 1) totalPages = 1;