Skip to content

Commit 1ba5fa2

Browse files
committed
share other privacy settings as well
1 parent 21d8ca1 commit 1ba5fa2

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

app/src/settings/privacy.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ define_settings_group!(WarpDrivePrivacySettings, settings: [
9393
default: true,
9494
supported_platforms: SupportedPlatforms::ALL,
9595
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::No),
96-
surface: settings::SettingSurfaces::GUI,
96+
surface: settings::SettingSurfaces::ALL,
9797
private: false,
9898
storage_key: "TelemetryEnabled",
9999
toml_path: "privacy.telemetry_enabled",
@@ -104,7 +104,7 @@ define_settings_group!(WarpDrivePrivacySettings, settings: [
104104
default: true,
105105
supported_platforms: SupportedPlatforms::ALL,
106106
sync_to_cloud: SyncToCloud::Globally(RespectUserSyncSetting::No),
107-
surface: settings::SettingSurfaces::GUI,
107+
surface: settings::SettingSurfaces::ALL,
108108
private: false,
109109
storage_key: "CrashReportingEnabled",
110110
toml_path: "privacy.crash_reporting_enabled",
@@ -857,3 +857,7 @@ impl Entity for PrivacySettings {
857857
}
858858

859859
impl SingletonEntity for PrivacySettings {}
860+
861+
#[cfg(test)]
862+
#[path = "privacy_tests.rs"]
863+
mod tests;

app/src/settings/privacy_tests.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
use settings::schema::SettingSchemaEntry;
2+
use settings::{Setting, SettingSurfaces, SettingsMode};
3+
4+
use super::{IsCloudConversationStorageEnabled, IsCrashReportingEnabled, IsTelemetryEnabled};
5+
6+
#[test]
7+
fn privacy_settings_apply_to_gui_and_tui() {
8+
for storage_key in [
9+
IsTelemetryEnabled::toml_key(),
10+
IsCrashReportingEnabled::toml_key(),
11+
IsCloudConversationStorageEnabled::toml_key(),
12+
] {
13+
let entry = inventory::iter::<SettingSchemaEntry>
14+
.into_iter()
15+
.find(|entry| entry.storage_key == storage_key)
16+
.unwrap_or_else(|| panic!("missing schema entry for {storage_key}"));
17+
let surfaces = (entry.surfaces_fn)();
18+
19+
assert_eq!(surfaces, SettingSurfaces::ALL, "{storage_key}");
20+
assert!(surfaces.includes(SettingsMode::Gui), "{storage_key}");
21+
assert!(surfaces.includes(SettingsMode::Tui), "{storage_key}");
22+
}
23+
}

0 commit comments

Comments
 (0)