Mountain/IPC/WindServiceHandlers/Navigation/HistoryGoBack.rs
1//! Pop the previous URI off the back-stack and return it.
2//! `None` when the stack is empty (caller should disable the
3//! back button).
4
5use std::sync::Arc;
6
7use serde_json::Value;
8
9use crate::RunTime::ApplicationRunTime::ApplicationRunTime;
10
11pub async fn Fn(RunTime:Arc<ApplicationRunTime>) -> Result<Value, String> {
12 let Uri = RunTime.Environment.ApplicationState.Feature.NavigationHistory.GoBack();
13
14 Ok(Uri.map(Value::String).unwrap_or(Value::Null))
15}