Skip to content

Commit

Permalink
Merge pull request #44 from Ktraveller285/mugifly/remember-notificati…
Browse files Browse the repository at this point in the history
…on-email

Remember notification email address using local storage
  • Loading branch information
Ktraveller285 authored Oct 2, 2024
2 parents 642309d + 22e9504 commit 8092c01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/app/notice-register/notice-register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
matInput
placeholder="[email protected]"
required
[(ngModel)]="noticeEmail"
#noticeEmail
/>
</mat-form-field>
Expand Down
3 changes: 3 additions & 0 deletions src/app/notice-register/notice-register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { TrainService } from '../train.service';
})
export class NoticeRegisterComponent implements OnInit {
public lineName!: string | null;
public noticeEmail: string = '';

constructor(
public trainService: TrainService,
Expand Down Expand Up @@ -43,6 +44,7 @@ export class NoticeRegisterComponent implements OnInit {
cancelDecisionTime,
noticeEmail
);
window.localStorage.setItem('noticeEmail', noticeEmail);
} catch (e: any) {
// メッセージ表示
this.snackbar.open(
Expand All @@ -63,5 +65,6 @@ export class NoticeRegisterComponent implements OnInit {

ngOnInit(): void {
this.lineName = this.activatedRoute.snapshot.queryParamMap.get('line');
this.noticeEmail = window.localStorage.getItem('noticeEmail') || '';
}
}

0 comments on commit 8092c01

Please sign in to comment.