From 4cb79f1d5db5de289f677963699af17d2d772705 Mon Sep 17 00:00:00 2001 From: Owen Melbourne Date: Tue, 9 Feb 2021 11:25:51 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Bug=20-=20fixing=20visual=20diff?= =?UTF-8?q?=20controller?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Checkers/BrowserConsole.php | 2 +- app/Http/Controllers/VisualDiffsController.php | 4 ++-- config/app.php | 4 ++++ config/odin.php | 7 ------- 4 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 config/odin.php diff --git a/app/Checkers/BrowserConsole.php b/app/Checkers/BrowserConsole.php index 243748d..37814b8 100644 --- a/app/Checkers/BrowserConsole.php +++ b/app/Checkers/BrowserConsole.php @@ -65,7 +65,7 @@ private function shouldReport($messages) return false; } - foreach (config('odin.ignore_console_errors') as $phrase) { + foreach (config('app.ignore_console_errors') as $phrase) { if (Str::contains($messages, $phrase)) { return false; } diff --git a/app/Http/Controllers/VisualDiffsController.php b/app/Http/Controllers/VisualDiffsController.php index 41f58d7..dcdf258 100644 --- a/app/Http/Controllers/VisualDiffsController.php +++ b/app/Http/Controllers/VisualDiffsController.php @@ -39,7 +39,7 @@ public function __invoke(Request $request, Website $website) if ($result->count() !== 2) { return null; } - + $previous = $result->last(); $current = $result->first(); @@ -54,7 +54,7 @@ public function __invoke(Request $request, Website $website) 'diff' => $current->diff_url, 'date' => $current->created_at, ]; - })->filter(); + })->filter()->values(); } /** diff --git a/config/app.php b/config/app.php index 3a06833..5cf0a29 100644 --- a/config/app.php +++ b/config/app.php @@ -7,6 +7,10 @@ // How many days of uptime to report on? This effects DB performance. 'max_uptime_age' => env('MAX_UPTIME_AGE', 90), + 'ignore_console_errors' => [ + 'app/Crawler/browser.js', + ], + /* |-------------------------------------------------------------------------- | Application Name diff --git a/config/odin.php b/config/odin.php deleted file mode 100644 index c290add..0000000 --- a/config/odin.php +++ /dev/null @@ -1,7 +0,0 @@ - [ - 'app/Crawler/browser.js', - ], -];