Browse Source

use SystemTime for history events

master
yggverse 2 months ago
parent
commit
1622529c89
  1. 9
      src/browser/main/tab/page/navigation/history.rs

9
src/browser/main/tab/page/navigation/history.rs

@ -5,11 +5,11 @@ use back::Back;
use forward::Forward; use forward::Forward;
use gtk::{gio::SimpleAction, glib::GString, prelude::BoxExt, Box, Orientation}; 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 { struct Memory {
request: GString, request: GString,
time: i32, // @TODO time: SystemTime,
} }
pub struct History { pub struct History {
@ -65,7 +65,10 @@ impl History {
// Actions // Actions
pub fn add(&self, request: GString, follow_to_index: bool) { pub fn add(&self, request: GString, follow_to_index: bool) {
// Append new Memory record // 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 { if follow_to_index {
// Navigate to the last record appended // Navigate to the last record appended

Loading…
Cancel
Save