fix(scripts): Avoid adding duplicate scripts
This commit is contained in:
parent
a87686a94f
commit
454ce19f08
1 changed files with 6 additions and 1 deletions
|
|
@ -93,8 +93,13 @@ impl App {
|
||||||
};
|
};
|
||||||
|
|
||||||
let script_receiver = async {
|
let script_receiver = async {
|
||||||
while let Some(script) = rx.recv().await {
|
'outer: while let Some(script) = rx.recv().await {
|
||||||
tracing::debug!("appending script: {:?}", script);
|
tracing::debug!("appending script: {:?}", script);
|
||||||
|
for cached_script in &self.scripts {
|
||||||
|
if cached_script.name == script.name {
|
||||||
|
continue 'outer;
|
||||||
|
}
|
||||||
|
}
|
||||||
self.scripts.push(script);
|
self.scripts.push(script);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue