From d385c0d80c744505ee82dc13970856276c9dfcc8 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 3 Nov 2022 19:00:15 -0500 Subject: [PATCH] Developers, SW: check 'waiting' before 'active' --- .../developers/service-worker-info.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/soapbox/features/developers/service-worker-info.tsx b/app/soapbox/features/developers/service-worker-info.tsx index 18800f1de0..9b77515876 100644 --- a/app/soapbox/features/developers/service-worker-info.tsx +++ b/app/soapbox/features/developers/service-worker-info.tsx @@ -50,10 +50,10 @@ const ServiceWorkerInfo: React.FC = () => { const url = registration?.active?.scriptURL; const getState = () => { - if (registration?.active) { - return 'active'; - } else if (registration?.waiting) { + if (registration?.waiting) { return 'pending'; + } else if (registration?.active) { + return 'active'; } else { return 'inactive'; } @@ -74,13 +74,6 @@ const ServiceWorkerInfo: React.FC = () => { defaultMessage='Unavailable' /> ); - } else if (registration?.active) { - return ( - - ); } else if (registration?.waiting) { return ( = () => { defaultMessage='Waiting' /> ); + } else if (registration?.active) { + return ( + + ); } else { return (