From 98786ca827a7ce7ea397c9e7e6a79b7cba7f696f Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sun, 7 Apr 2024 10:54:24 -0400 Subject: [PATCH] fix wasm log ignore bug --- veilid-wasm/src/lib.rs | 4 ++-- veilid-wasm/src/veilid_client_js.rs | 14 ++++++-------- veilid-wasm/tests/package-lock.json | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/veilid-wasm/src/lib.rs b/veilid-wasm/src/lib.rs index 6f636801..76d95ab9 100644 --- a/veilid-wasm/src/lib.rs +++ b/veilid-wasm/src/lib.rs @@ -272,7 +272,7 @@ pub fn change_log_ignore(layer: String, log_ignore: String) { // Change all layers for f in filters.values() { f.set_ignore_list(Some(VeilidLayerFilter::apply_ignore_change( - f.ignore_list(), + &f.ignore_list(), log_ignore.clone(), ))); } @@ -280,7 +280,7 @@ pub fn change_log_ignore(layer: String, log_ignore: String) { // Change a specific layer let f = filters.get(layer.as_str()).unwrap(); f.set_ignore_list(Some(VeilidLayerFilter::apply_ignore_change( - f.ignore_list(), + &f.ignore_list(), log_ignore.clone(), ))); } diff --git a/veilid-wasm/src/veilid_client_js.rs b/veilid-wasm/src/veilid_client_js.rs index 20ec6e3b..0fd7a3af 100644 --- a/veilid-wasm/src/veilid_client_js.rs +++ b/veilid-wasm/src/veilid_client_js.rs @@ -136,18 +136,16 @@ impl VeilidClient { if layer.is_empty() { // Change all layers for f in filters.values() { - f.set_ignore_list(Some(VeilidLayerFilter::apply_ignore_change( - f.ignore_list(), - changes.clone(), - ))); + let mut ignore_list = f.ignore_list(); + VeilidLayerFilter::apply_ignore_change_list(&mut ignore_list, &changes); + f.set_ignore_list(Some(ignore_list)); } } else { // Change a specific layer let f = filters.get(layer.as_str()).unwrap(); - f.set_ignore_list(Some(VeilidLayerFilter::apply_ignore_change( - f.ignore_list(), - changes.clone(), - ))); + let mut ignore_list = f.ignore_list(); + VeilidLayerFilter::apply_ignore_change_list(&mut ignore_list, &changes); + f.set_ignore_list(Some(ignore_list)); } } /// Shut down Veilid and terminate the API. diff --git a/veilid-wasm/tests/package-lock.json b/veilid-wasm/tests/package-lock.json index a0082466..b65a28d9 100644 --- a/veilid-wasm/tests/package-lock.json +++ b/veilid-wasm/tests/package-lock.json @@ -21,7 +21,7 @@ }, "../pkg": { "name": "veilid-wasm", - "version": "0.2.5", + "version": "0.3.1", "dev": true, "license": "MPL-2.0" },