From d72b00cb870fb6b65f0b4335eb0f9ac8f22ad241 Mon Sep 17 00:00:00 2001 From: teddit Date: Fri, 8 Jan 2021 21:49:07 +0100 Subject: [PATCH] fix subreddit view when there are no subscriptions --- views/subreddit.pug | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/views/subreddit.pug b/views/subreddit.pug index 95c2232..4e9d0da 100644 --- a/views/subreddit.pug +++ b/views/subreddit.pug @@ -185,10 +185,12 @@ html each subreddit in subreddits - let subbed_to_this_subreddit = false - let subbed = user_preferences.subbed_subreddits - for(let i = 0; i < subbed.length; i++) { - if(subbed[i] === subreddit) - subbed_to_this_subreddit = true + if(user_preferences.subbed_subreddits) { + let subbed = user_preferences.subbed_subreddits + for(let i = 0; i < subbed.length; i++) { + if(subbed[i] === subreddit) + subbed_to_this_subreddit = true + } } li if subbed_to_this_subreddit