Skip to content

Commit 672575f

Browse files
authored
fix: functions issue add same function again (#2875)
1 parent bc22d8c commit 672575f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/service/functions.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ pub async fn add_function_to_stream(
293293
stream_order.stream_type = stream_type;
294294

295295
if let Some(mut val) = existing_fn.streams {
296-
val.push(stream_order);
296+
if let Some(existing) = val.iter_mut().find(|x| x.stream == stream_order.stream) {
297+
existing.is_removed = false;
298+
} else {
299+
val.push(stream_order);
300+
}
297301
existing_fn.streams = Some(val);
298302
} else {
299303
existing_fn.streams = Some(vec![stream_order]);

0 commit comments

Comments
 (0)