Skip to content

Commit

Permalink
option not to set notif!
Browse files Browse the repository at this point in the history
  • Loading branch information
mehanix committed Mar 15, 2021
1 parent abc3850 commit 97501aa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>Ripple</name>
<description>Aplicatie care te ajuta sa descoperi lucruri noi in fiecare zi!</description>
<author email="[email protected]" href="http://ionicframework.com/">Nicoleta Ciausu (mehanix)</author>
<content original-src="index.html" src="https://localhost:8100" />
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
Expand Down
9 changes: 6 additions & 3 deletions src/app/setup/timeset/timeset.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ <h1>Super!</h1>
</ion-col>
</ion-row>

<ion-row>
<a href="https://www.google.com" class="link-text">Nu vreau sa fiu notificat</a>
<ion-row align="center" class="ion-justify-content-center ion-align-items-center">

<a href="#" (click)="finishSetup(false)" routerLink="/main-tabs" class="link-text" >Nu vreau sa fiu notificat</a>


</ion-row>

<ion-row class="button-row ion-align-items-end" >
Expand All @@ -27,7 +30,7 @@ <h1>Super!</h1>
<ion-col>


<ion-button expand="full" color="secondary" (click)="finishSetup()" routerLink="/main-tabs">Gata!</ion-button>
<ion-button expand="full" color="secondary" (click)="finishSetup(true)" routerLink="/main-tabs">Gata!</ion-button>

</ion-col>
</ion-row>
Expand Down
3 changes: 2 additions & 1 deletion src/app/setup/timeset/timeset.page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ h1 {
}

.link-text {
color: var(--ion-color-secondary)
color: var(--ion-color-light);
text-align: center;
}
34 changes: 21 additions & 13 deletions src/app/setup/timeset/timeset.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,30 @@ export class TimesetPage implements OnInit {

}

finishSetup() {

console.log(this.hr);
console.log(this.min);
this.localNotifications.schedule({
id: 42,
title: "Here's your lesson for the day!",
text: 'Ready to learn?',
trigger: { every: { hour: this.hr, minute: this.min } },
smallIcon: 'res://ic_stat_notify.png',
icon: 'res://icon.png',
});
console.log("bop")
finishSetup(setNotification:boolean) {

if(setNotification==true) {

this.localNotifications.schedule({
id: 42,
title: "Here's your lesson for the day!",
text: 'Ready to learn?',
trigger: { every: { hour: this.hr, minute: this.min } },
smallIcon: 'res://ic_stat_notify.png',
icon: 'res://icon.png',
});

}
else
{
this.localNotifications.clearAll();
}

this.storage.set('setupComplete', true);

}



}

0 comments on commit 97501aa

Please sign in to comment.