Skip to main content

Mountain/IPC/WindServiceHandlers/UI/
WorkingCopySetDirty.rs

1//! Wire method: `workingCopy:setDirty`.
2
3use std::sync::Arc;
4
5use serde_json::Value;
6
7use crate::{
8	IPC::WindServiceHandlers::Utilities::JsonValueHelpers::arg_bool_true,
9	RunTime::ApplicationRunTime::ApplicationRunTime,
10};
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("workingCopy:setDirty requires uri".to_string())?;
17
18	let Dirty = arg_bool_true(&Arguments, 1);
19
20	RunTime.Environment.ApplicationState.Feature.WorkingCopy.SetDirty(Uri, Dirty);
21
22	Ok(Value::Null)
23}