Skip to content

Commit

Permalink
Added New Logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Varshithvhegde committed Oct 24, 2023
1 parent 092db82 commit a722eff
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
37 changes: 18 additions & 19 deletions src/app/navigation/navigation.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ export class NavigationComponent {
routeId: string | null | undefined;

@Input()
locked : boolean = false;
password : string = '';
datalocked : boolean = false;
locked: boolean = false;
password: string = '';
datalocked: boolean = false;
constructor(
private router: Router,
private route: ActivatedRoute,
private dialog: MatDialog,
private passwordService: UnlockService,
private toast : NgToastService
private toast: NgToastService
) {
this.router.events.subscribe((event) => {
if (event instanceof NavigationEnd) {
Expand All @@ -59,33 +59,33 @@ export class NavigationComponent {
});
}

unlock(){
unlock() {
// Get the route ID
const routeID = this.routeId;

// Check if the route ID exists
if (routeID) {
// Create a reference to the Firebase Realtime Database
const db = getDatabase();

// Define the data object to update the password
const dataToUpdate = {
password: '',
locked : false
locked: false,
};

// Update the password in the database
update(ref(db, routeID), dataToUpdate)
.then(() => {
this.toast.success({detail : 'Page unlocked successfully'});
console.log('Password updated successfully');
.then(() => {
this.toast.success({ detail: 'Page unlocked successfully' });
console.log('Password updated successfully');
})
.catch((error) => {
this.toast.error({detail : 'Error unlocking page'});
this.toast.error({ detail: 'Error unlocking page' });
console.error('Error updating password:', error);
});
} else {
this.toast.error({detail : 'Error unlocking page'});
this.toast.error({ detail: 'Error unlocking page' });
console.error('Route ID is null or undefined');
}
}
Expand All @@ -103,11 +103,10 @@ export class NavigationComponent {
openPasswordInputDialog() {
const dialogRef = this.dialog.open(PasswordInputDialogComponent, {
width: '300px', // Set the desired width
data : {locked : this.datalocked, password : this.password}
data: { locked: this.datalocked, password: this.password },
});

dialogRef.afterClosed().subscribe((result) => {

// if result == cancel then return
if (result == 'cancel') {
return;
Expand All @@ -134,17 +133,17 @@ export class NavigationComponent {
// Define the data object to update the password
const dataToUpdate = {
password: newPassword,
locked : true
locked: true,
};

// Update the password in the database
update(ref(db, routeID), dataToUpdate)
.then(() => {
this.toast.success({detail : 'Password updated successfully'});
this.toast.success({ detail: 'Password updated successfully' });
console.log('Password updated successfully');
})
.catch((error) => {
this.toast.error({detail : 'Error updating password'});
this.toast.error({ detail: 'Error updating password' });
console.error('Error updating password:', error);
});
} else {
Expand Down
Binary file added src/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Notecode</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/x-icon" href="assets\favicon.png">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
Expand Down

0 comments on commit a722eff

Please sign in to comment.