From e938990f84620def4f270322ca213ab537f74eb4 Mon Sep 17 00:00:00 2001 From: tpmai22 Date: Wed, 16 Feb 2022 13:52:25 -0500 Subject: [PATCH] Stop the dashboard UI from stutter by checking the build sha --- src/api/status/public/js/build-log/check-for-build.js | 10 +++++++++- src/api/status/public/js/pages/build.js | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/api/status/public/js/build-log/check-for-build.js b/src/api/status/public/js/build-log/check-for-build.js index 4536c276c5..471b1b812f 100644 --- a/src/api/status/public/js/build-log/check-for-build.js +++ b/src/api/status/public/js/build-log/check-for-build.js @@ -3,11 +3,19 @@ import terminal from './terminal.js'; import buildHeader from './build-header.js'; import showToast from '../utils/toast.js'; +let build; + export default async function checkForBuild() { const status = await checkBuildStatus(); // Prefer the current build, but fallback to the previous one - const build = status.current ?? status.previous; + const buildData = status.current ?? status.previous; + + if (build && build.sha === buildData.sha) { + return; + } + + build = buildData; // Render the build header info buildHeader(build); diff --git a/src/api/status/public/js/pages/build.js b/src/api/status/public/js/pages/build.js index 5900a32905..ee064aa388 100644 --- a/src/api/status/public/js/pages/build.js +++ b/src/api/status/public/js/pages/build.js @@ -3,5 +3,5 @@ import './main.js'; window.addEventListener('load', () => { checkForBuild(); - setInterval(checkForBuild, 5000); + setInterval(checkForBuild, 10000); });