Apply suggestions from code review

Co-authored-by: Surma <surma@surma.dev>
This commit is contained in:
Pete LePage
2020-06-24 09:40:56 -04:00
committed by GitHub
parent 6065ceabfe
commit 4fa73be842
2 changed files with 12 additions and 10 deletions

View File

@@ -52,10 +52,7 @@ interface State {
}
export default class Intro extends Component<Props, State> {
state: State = {
deferredPrompt: undefined,
installSource: undefined,
};
state: State = {};
private fileInput?: HTMLInputElement;
private installButton?: HTMLButtonElement;
@@ -137,10 +134,7 @@ export default class Intro extends Component<Props, State> {
deferredPrompt.prompt();
// Wait for the user to accept or dismiss the install prompt
const response = await deferredPrompt.userChoice;
// Get the outcome and log it
const outcome = response.outcome;
const {outcome} = await deferredPrompt.userChoice;
ga('send', 'event', 'pwa-install', installSource, outcome);
// If the prompt was dismissed, clear the installSource.

View File

@@ -181,13 +181,21 @@
background: #fff;
border: 1px solid #e8e8e8;
margin-top: 1em;
align-items: center;
padding: 14px;
font-size: 1.3rem;
position: absolute;
top: 1rem;
right: 1rem;
display: none;
opacity: 0;
animation: fade-in .3s linear 1s forwards;
}
@keyframes fade-in {
to {opacity: 1;}
}
.related-links {