FIX: makes sure we have a zone (#6686)

FIX: makes sure we have a zone (#6686)

From 04558b6ca409411bb8a7e6660e47a3b3779d5a3f Mon Sep 17 00:00:00 2001
From: Joffrey JAFFEUX <j.jaffeux@gmail.com>
Date: Tue, 27 Nov 2018 16:42:23 +0100
Subject: [PATCH] FIX: makes sure we have a zone (#6686)


diff --git a/plugins/discourse-local-dates/assets/javascripts/discourse-local-dates.js.no-module.es6 b/plugins/discourse-local-dates/assets/javascripts/discourse-local-dates.js.no-module.es6
index f0648ec..15fcee7 100644
--- a/plugins/discourse-local-dates/assets/javascripts/discourse-local-dates.js.no-module.es6
+++ b/plugins/discourse-local-dates/assets/javascripts/discourse-local-dates.js.no-module.es6
@@ -215,6 +215,7 @@
       }
 
       if (
+        options.timezone &&
         displayedTimezone === watchingUserTimezone &&
         options.timezone !== displayedTimezone &&
         !compareZones(displayedTimezone, options.timezone)
@@ -222,7 +223,7 @@
         timezones.unshift(options.timezone);
       }
 
-      timezones.forEach(timezone => {
+      timezones.filter(z => z).forEach(timezone => {
         if (compareZones(timezone, displayedTimezone)) {
           return;
         }

GitHub

2 Likes