fix: Copy canned queries to clipboard on click

Instead of trying to update the text directly, which causes the front end
to overwrite the user's changes everytime the data updates from then on.
This commit is contained in:
John Colvin committed 2024-10-30 19:31:09 +00:00
1 parent 156ec8f3a8
commit 587e340071
2 files changed
+30 -6

No files matched your search

@@ -116,12 +116,15 @@ public class DataPacketJsonConverter : JsonConverter<DataPacket> {
}
if (t == typeof(double)) {
return NullCheckWrapper(v => {
var dbl = ConvertUtils.try_convert(v, double.NaN);
var dbl = Equals(v, DBNull.Value) ? double.NaN : (double)v;
JsonSerializer.Serialize(writer, dbl, options);
});
}
if (t == typeof(float)) {
return NullCheckWrapper(v => writer.WriteNumberValue((float)v));
return NullCheckWrapper(v => {
var flt = Equals(v, DBNull.Value) ? float.NaN : (float)v;
writer.WriteNumberValue(flt);
});
}
if (t == typeof(bool)) {
return NullCheckWrapper(v => writer.WriteBooleanValue((bool)v));