Remove themes from the registry when the extension is uninstalled (#7745)

This PR makes it so uninstalling an extension will remove any themes
provided by that extension from the theme registry.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-02-13 16:41:34 -05:00 committed by GitHub
parent e9b95fde68
commit c3176392c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 42 additions and 2 deletions

View file

@ -189,6 +189,14 @@ impl ThemeRegistry {
}));
}
/// Removes the themes with the given names from the registry.
pub fn remove_user_themes(&self, themes_to_remove: &[SharedString]) {
self.state
.write()
.themes
.retain(|name, _| !themes_to_remove.contains(name))
}
pub fn clear(&mut self) {
self.state.write().themes.clear();
}