Skip to main content

Mountain/IPC/WindServiceHandlers/Navigation/
HistoryPush.rs

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