Skip to content

Commit

Permalink
Fix handling of modified source code URL setting
Browse files Browse the repository at this point in the history
  • Loading branch information
nooptek committed Feb 18, 2024
1 parent 1e6ec60 commit 6a526de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/invidious/routes/preferences.cr
Expand Up @@ -214,7 +214,7 @@ module Invidious::Routes::PreferencesRoute
statistics_enabled ||= "off"
CONFIG.statistics_enabled = statistics_enabled == "on"

CONFIG.modified_source_code_url = env.params.body["modified_source_code_url"]?.try &.as(String)
CONFIG.modified_source_code_url = env.params.body["modified_source_code_url"]?.presence

File.write("config/config.yml", CONFIG.to_yaml)
end
Expand Down
2 changes: 1 addition & 1 deletion src/invidious/views/user/preferences.ecr
Expand Up @@ -310,7 +310,7 @@

<div class="pure-control-group">
<label for="modified_source_code_url"><%= translate(locale, "adminprefs_modified_source_code_url_label") %></label>
<input name="modified_source_code_url" id="modified_source_code_url" type="input" <% if CONFIG.modified_source_code_url %>checked<% end %>>
<input name="modified_source_code_url" id="modified_source_code_url" type="url" value="<%= CONFIG.modified_source_code_url %>">
</div>
<% end %>

Expand Down

0 comments on commit 6a526de

Please sign in to comment.