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