Skip to content

Commit

Permalink
Adds confirmation to dismissing add to home screen dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
neilmenon committed Dec 12, 2023
1 parent 5e071c7 commit e86dfd8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<img src="/assets/icons/icon-48x48.png">
<span style="display: block; text-align: center; margin-top: -4px; font-weight: bold;">N.M.T</span>
</span>
<span style="padding-left: 0.5rem;">For the best experience, install the app by clicking the <img src="/assets/img/share-icon-ios.jpeg" matTooltip="Share Button" style="width: auto; height: 18px; vertical-align: middle; border-radius: 2px;"> button below (in <strong>Safari</strong>) and selecting <strong>Add to Home Screen</strong>.</span>
<span style="padding-left: 0.5rem;" *ngIf="!dismissedOnce">For all the features, install the app by clicking the <img src="/assets/img/share-icon-ios.jpeg" matTooltip="Share Button" style="width: auto; height: 18px; vertical-align: middle; border-radius: 2px;"> button below (in <strong>Safari</strong>) and selecting <strong>Add to Home Screen</strong>.</span>
<span style="padding-left: 0.5rem;" *ngIf="dismissedOnce">Are you sure? The app won't function like a regular iOS app without adding to the home screen (no push notifications, etc).</span>
<span style="min-width: 24px; padding-right: 0.75rem;" matTooltip="Dismiss" (click)="dismiss()" class="clickable">
<mat-icon>close</mat-icon>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@ import { Component } from '@angular/core';
styleUrl: './add-to-homescreen.component.css'
})
export class AddToHomescreenComponent {
dismissedOnce: boolean

dismiss() {
if (!this.dismissedOnce) {
this.dismissedOnce = true
return
}
localStorage.setItem("dismissAddToHomescreen", "true")
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/components/anniversify/anniversify.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h2>Email Notifications</h2>
</mat-form-field>
</div>
<div>
<h2>Push Notifications (iOS Only)</h2>
<h2>Push Notifications</h2>
<p>
Requires iOS 16.4 or later and the app added to your home screen from Safari. Receive a push notification on this device when you have an anniversary.
<span *ngIf="dismissedAddToHomeScreen()" class="action-link clickable" (click)="showHomescreenInstructions()"><br>Show Instructions</span>
Expand Down

0 comments on commit e86dfd8

Please sign in to comment.