From 36e08165d6efb21b34f78676f2a2024489c3d2b2 Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Thu, 2 Jan 2020 20:18:46 +0530 Subject: [PATCH] fix fs stats.mtime usage in config.js --- app/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/config.js b/app/config.js index 1f2ce686..06bb119d 100644 --- a/app/config.js +++ b/app/config.js @@ -30,10 +30,10 @@ const _watch = () => { // watch for changes on config every 2s on Windows // https://github.com/zeit/hyper/pull/1772 _watcher = fs.watchFile(cfgPath, {interval: 2000}, (curr, prev) => { - if (curr.mtime === 0) { + if (!curr.mtime || curr.mtime.getTime() === 0) { //eslint-disable-next-line no-console console.error('error watching config'); - } else if (curr.mtime !== prev.mtime) { + } else if (curr.mtime.getTime() !== prev.mtime.getTime()) { onChange(); } });