mirror of
https://github.com/iv-org/invidious.git
synced 2026-10-24 22:09:13 -05:00
fix comment preferences for nojs
This commit is contained in:
parent
a61118a15a
commit
ba4318b62e
@ -73,25 +73,13 @@ module Invidious::Routes::Watch
|
||||
|
||||
if nojs
|
||||
if preferences
|
||||
# Disables youtube comments
|
||||
source = preferences.comments[0]
|
||||
|
||||
if source.empty?
|
||||
source = preferences.comments[1]
|
||||
end
|
||||
|
||||
if source == "youtube"
|
||||
begin
|
||||
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
|
||||
rescue
|
||||
if preferences.comments[1] == "youtube"
|
||||
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
comment_html = JSON.parse(Comments.fetch_youtube(id, nil, "html", locale, preferences.thin_mode, region))["contentHtml"]
|
||||
end
|
||||
|
||||
comment_html ||= ""
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user