Skip to content

Commit 5e95d82

Browse files
committed
fix(instance_info): show DEFAULT_PUSHSHIFT_FRONTEND when pushshift is unset
1 parent e665360 commit 5e95d82

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/instance_info.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ impl InstanceInfo {
108108
fn to_table(&self) -> String {
109109
let mut container = Container::default();
110110
let convert = |o: &Option<String>| -> String { o.clone().unwrap_or_else(|| "<span class=\"unset\"><i>Unset</i></span>".to_owned()) };
111+
// Pushshift: show the configured value, or fall back to the compiled-in default.
112+
let pushshift_display = self.config.pushshift.clone().unwrap_or_else(|| crate::config::DEFAULT_PUSHSHIFT_FRONTEND.to_owned());
111113
if let Some(banner) = &self.config.banner {
112114
container.add_header(3, "Instance banner");
113115
container.add_raw("<br />");
@@ -123,11 +125,10 @@ impl InstanceInfo {
123125
["Deploy timestamp", &self.deploy_unix_ts.to_string()],
124126
["Compile mode", &self.compile_mode],
125127
["SFW only", &convert(&self.config.sfw_only)],
126-
["Pushshift frontend", &convert(&self.config.pushshift)],
128+
["Pushshift frontend", &pushshift_display],
127129
["RSS enabled", &convert(&self.config.enable_rss)],
128130
["Full URL", &convert(&self.config.full_url)],
129131
["Remove default feeds", &convert(&self.config.default_remove_default_feeds)],
130-
//TODO: fallback to crate::config::DEFAULT_PUSHSHIFT_FRONTEND
131132
])
132133
.with_header_row(["Settings"]),
133134
);

0 commit comments

Comments
 (0)