theme: Remove unused staff parameter for listing themes (#20077)

This PR removes the `staff` parameter for listing themes, as it was not
used.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-01 10:54:21 -04:00 committed by GitHub
parent af9e7f1f96
commit a960344301
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 13 additions and 23 deletions

View file

@ -39,10 +39,10 @@ impl Global for GlobalThemeRegistry {}
#[async_trait]
pub trait ThemeRegistry: Send + Sync + 'static {
/// Returns the names of all themes in the registry.
fn list_names(&self, _staff: bool) -> Vec<SharedString>;
fn list_names(&self) -> Vec<SharedString>;
/// Returns the metadata of all themes in the registry.
fn list(&self, _staff: bool) -> Vec<ThemeMeta>;
fn list(&self) -> Vec<ThemeMeta>;
/// Returns the theme with the given name.
fn get(&self, name: &str) -> Result<Arc<Theme>>;
@ -171,13 +171,13 @@ impl Default for RealThemeRegistry {
#[async_trait]
impl ThemeRegistry for RealThemeRegistry {
fn list_names(&self, _staff: bool) -> Vec<SharedString> {
fn list_names(&self) -> Vec<SharedString> {
let mut names = self.state.read().themes.keys().cloned().collect::<Vec<_>>();
names.sort();
names
}
fn list(&self, _staff: bool) -> Vec<ThemeMeta> {
fn list(&self) -> Vec<ThemeMeta> {
self.state
.read()
.themes
@ -238,11 +238,11 @@ pub struct VoidThemeRegistry;
#[async_trait]
impl ThemeRegistry for VoidThemeRegistry {
fn list_names(&self, _staff: bool) -> Vec<SharedString> {
fn list_names(&self) -> Vec<SharedString> {
Vec::new()
}
fn list(&self, _staff: bool) -> Vec<ThemeMeta> {
fn list(&self) -> Vec<ThemeMeta> {
Vec::new()
}

View file

@ -711,7 +711,7 @@ impl settings::Settings for ThemeSettings {
) -> schemars::schema::RootSchema {
let mut root_schema = generator.root_schema_for::<ThemeSettingsContent>();
let theme_names = <dyn ThemeRegistry>::global(cx)
.list_names(params.staff_mode)
.list_names()
.into_iter()
.map(|theme_name| Value::String(theme_name.to_string()))
.collect();