going back in history sort of works, but is quite buggy

This commit is contained in:
deadvey 2025-01-13 14:43:00 +00:00
parent 0da9e95b2a
commit 67a5096267

View File

@ -317,7 +317,7 @@ fn main() {
load_page = true;
}
else if user_input == "b" {
if historical_position > 1 {
if historical_position >= 1 {
historical_position -= 1;
if let Ok(parsed_value) = parse_url(format!("{}://{}/{}",history[historical_position].protocol.clone(), history[historical_position].hostname.clone(),history[historical_position].path.clone()),&url.hostname) {
url = parsed_value;
@ -349,6 +349,9 @@ fn main() {
port: url.port.clone(),
path: url.path.clone(),
});
for i in historical_position+1..history.len()-1 {
history.remove(i);
}
historical_position += 1;
load_page = true;
}