empty notes save fix. correct default value if no current zone aggregate first entry found.

main 1.8.2
isark 1 year ago
parent 5730861acf
commit 67f43d4b7f

@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "Nothing", "productName": "Nothing",
"version": "1.8.0" "version": "1.8.2"
}, },
"tauri": { "tauri": {
"systemTray": { "systemTray": {

@ -149,7 +149,7 @@ export class AggregateDisplayComponent {
} }
currentFirst() { currentFirst() {
return (this.currentAggregate?.get(this.latestEntry!.zone)?.aggregateFirstEntry) ?? 0; return (this.currentAggregate?.get(this.latestEntry!.zone)?.aggregateFirstEntry) ?? this.latestEntry!.current_elapsed_millis;
} }
} }

@ -101,7 +101,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

@ -304,11 +304,12 @@ export class EditorComponent implements OnInit {
const dialogRef = this.dialog.open(EditNotesComponentDialog, { const dialogRef = this.dialog.open(EditNotesComponentDialog, {
data: { data: {
note: item.notes note: item.notes
} },
}) disableClose: true
},)
dialogRef.afterClosed().subscribe(note => { dialogRef.afterClosed().subscribe(note => {
if (note) { if (note != undefined && note != null) {
if (item.notes !== note) { if (item.notes !== note) {
item.edited = true; item.edited = true;
} }

@ -12,6 +12,6 @@
</div> </div>
<div mat-dialog-actions> <div mat-dialog-actions>
<button mat-button color="warn" (click)="cancel()">Cancel</button> <button mat-button color="warn" (click)="cancel()">Cancel</button>
<button mat-button [mat-dialog-close]="note" cdkFocusInitial>Save</button> <button mat-button (click)="save()" cdkFocusInitial>Save</button>
</div> </div>
</div> </div>

@ -41,7 +41,8 @@ export class NotesComponent implements AfterViewInit {
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
}) })
export class EditNotesComponentDialog { export class EditNotesComponentDialog {
note: string; note?: string;
constructor( constructor(
public dialogRef: MatDialogRef<EditNotesComponentDialog>, public dialogRef: MatDialogRef<EditNotesComponentDialog>,
@Inject(MAT_DIALOG_DATA) public data: DialogData, @Inject(MAT_DIALOG_DATA) public data: DialogData,
@ -54,6 +55,10 @@ export class EditNotesComponentDialog {
} }
cancel() { cancel() {
this.dialogRef.close(); this.dialogRef.close(undefined);
}
save() {
this.dialogRef.close(this.note);
} }
} }

Loading…
Cancel
Save