Skip to main content

Mountain/IPC/WindServiceHandlers/Navigation/
HistoryPush.rs

1//! Push a URI onto the navigation history. Called by Wind every
2//! time the active editor changes, so the back/forward chain
3//! reflects the user's actual jump trail.
4
5use std::sync::Arc;
6
7use serde_json::Value;
8
9use crate::RunTime::ApplicationRunTime::ApplicationRunTime;
10
11pub async fn Fn(RunTime:Arc<ApplicationRunTime>, Arguments:Vec<Value>) -> Result<Value, String> {
12	let Uri = Arguments
13		.first()
14		.and_then(|V| V.as_str())
15		.ok_or("history:push requires uri".to_string())?
16		.to_owned();
17
18	RunTime.Environment.ApplicationState.Feature.NavigationHistory.Push(Uri);
19
20	Ok(Value::Null)
21}