[polari/wip/carlosg/tracker: 425/445] chatView: Use unix timestamps for comparisons
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/carlosg/tracker: 425/445] chatView: Use unix timestamps for comparisons
- Date: Mon, 21 Jun 2021 22:04:10 +0000 (UTC)
commit 86514dfb52a9c8ab28299d8cb3781538ee1dd374
Author: Carlos Garnacho <carlosg gnome org>
Date: Sun Feb 24 22:43:55 2019 +0100
chatView: Use unix timestamps for comparisons
This is weird, but even though the compared objects are GDateTime, it
sometimes fail with:
JS ERROR: TypeError: logs[pos].get_time(...).equal is not a function
However fetching unix timestamps and comparing those works, so let's
go with it...
src/chatView.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 1bc7e21e..127ebc3d 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -605,7 +605,7 @@ const ChatView = GObject.registerClass({
if (logs[pos].get_sender() === firstPending.get_sender() &&
logs[pos].get_text() === firstPending.get_text() &&
logs[pos].is_action() === firstPending.is_action() &&
- logs[pos].get_time().equal(firstPending.get_time()))
+ logs[pos].get_time().to_unix() === firstPending.get_time().to_unix())
break;
}
// Remove entries that are also in pending (if any), then
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]