From 1622529c89fd114f7768f46443025b74ab1d7ff3 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 30 Sep 2024 21:53:24 +0300 Subject: [PATCH] use SystemTime for history events --- src/browser/main/tab/page/navigation/history.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/browser/main/tab/page/navigation/history.rs b/src/browser/main/tab/page/navigation/history.rs index 28338e98..106d3e64 100644 --- a/src/browser/main/tab/page/navigation/history.rs +++ b/src/browser/main/tab/page/navigation/history.rs @@ -5,11 +5,11 @@ use back::Back; use forward::Forward; use gtk::{gio::SimpleAction, glib::GString, prelude::BoxExt, Box, Orientation}; -use std::{cell::RefCell, sync::Arc}; +use std::{cell::RefCell, sync::Arc, time::SystemTime}; struct Memory { request: GString, - time: i32, // @TODO + time: SystemTime, } pub struct History { @@ -65,7 +65,10 @@ impl History { // Actions pub fn add(&self, request: GString, follow_to_index: bool) { // Append new Memory record - self.memory.borrow_mut().push(Memory { request, time: 0 }); + self.memory.borrow_mut().push(Memory { + request, + time: SystemTime::now(), + }); if follow_to_index { // Navigate to the last record appended