Skip to main content

Mountain/IPC/WindServiceHandlers/UI/
WorkingCopyIsDirty.rs

1#![allow(unused_variables)]
2
3//! Wire method: `workingCopy:isDirty`.
4
5use std::sync::Arc;
6
7use serde_json::{Value, json};
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("workingCopy:isDirty requires uri".to_string())?;
16
17	let IsDirty = RunTime.Environment.ApplicationState.Feature.WorkingCopy.IsDirty(Uri);
18
19	Ok(json!(IsDirty))
20}