fix: submit and form persistence on app on render change

This commit is contained in:
Ruben Fiszel
2024-07-30 15:43:37 +02:00
parent 5dee412ac8
commit a5edfb1da4
2 changed files with 10 additions and 3 deletions

View File

@@ -638,14 +638,12 @@ pub struct NativeAnnotation {
pub fn get_annotation(inner_content: &str) -> NativeAnnotation {
let mut res = NativeAnnotation { useragent: None, proxy: None };
#[cfg(feature = "enterprise")]
let anns = inner_content
.lines()
.take_while(|x| x.starts_with("//"))
.map(|x| x.to_string().trim_start_matches("//").trim().to_string())
.collect_vec();
#[cfg(feature = "enterprise")]
for ann in anns.iter() {
if ann.starts_with("useragent") {
res.useragent = Some(ann.trim_start_matches("useragent").trim().to_string());
@@ -704,6 +702,11 @@ pub async fn eval_fetch_timeout(
let ann = get_annotation(&ts_expr);
#[cfg(not(feature = "enterprise"))]
if ann.proxy.is_some() {
return Err(Error::ExecutionErr("Proxy is an EE feature".to_string()).into());
}
let mut extra_logs = String::new();
if ann.useragent.is_some() {
extra_logs.push_str(&format!("useragent: {}\n", ann.useragent.as_ref().unwrap()));

View File

@@ -182,8 +182,12 @@
}
}
let prevDefaultValue: any = undefined
async function changeDefaultValue(inputCat, defaultValue) {
value = defaultValue
if (value == null || value == undefined || value == prevDefaultValue) {
value = defaultValue
}
prevDefaultValue = defaultValue
if (value == null || value == undefined) {
if (defaultValue === undefined || defaultValue === null) {
if (inputCat === 'string') {