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:
parent
e9b95fde68
commit
c3176392c6
3 changed files with 42 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue