Developers, SW: check 'waiting' before 'active'

environments/review-gleasonato-trtlxz/deployments/1265^2
Alex Gleason 2022-11-03 19:00:15 -05:00
rodzic 66cd92970b
commit d385c0d80c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 10 dodań i 10 usunięć

Wyświetl plik

@ -50,10 +50,10 @@ const ServiceWorkerInfo: React.FC<IServiceWorkerInfo> = () => {
const url = registration?.active?.scriptURL; const url = registration?.active?.scriptURL;
const getState = () => { const getState = () => {
if (registration?.active) { if (registration?.waiting) {
return 'active';
} else if (registration?.waiting) {
return 'pending'; return 'pending';
} else if (registration?.active) {
return 'active';
} else { } else {
return 'inactive'; return 'inactive';
} }
@ -74,13 +74,6 @@ const ServiceWorkerInfo: React.FC<IServiceWorkerInfo> = () => {
defaultMessage='Unavailable' defaultMessage='Unavailable'
/> />
); );
} else if (registration?.active) {
return (
<FormattedMessage
id='sw.state.active'
defaultMessage='Active'
/>
);
} else if (registration?.waiting) { } else if (registration?.waiting) {
return ( return (
<FormattedMessage <FormattedMessage
@ -88,6 +81,13 @@ const ServiceWorkerInfo: React.FC<IServiceWorkerInfo> = () => {
defaultMessage='Waiting' defaultMessage='Waiting'
/> />
); );
} else if (registration?.active) {
return (
<FormattedMessage
id='sw.state.active'
defaultMessage='Active'
/>
);
} else { } else {
return ( return (
<FormattedMessage <FormattedMessage