Move dynamic string to View Model
This commit is contained in:
parent
8ec86974cd
commit
700f377d03
|
@ -136,7 +136,7 @@ export class PublishView extends Modal implements PublishViewModelDelegate {
|
|||
}
|
||||
})
|
||||
)
|
||||
.setDesc(this.viewModel.showInvalidDateMessage ? "Invalid date format" : "")
|
||||
.setDesc(this.viewModel.invalidDateText)
|
||||
}
|
||||
|
||||
public onClose() {
|
||||
|
|
|
@ -132,8 +132,8 @@ export class PublishViewModel implements TagSuggestionDelegate {
|
|||
return this.isValidDate && this.isSubmitting
|
||||
}
|
||||
|
||||
public get showInvalidDateMessage(): boolean {
|
||||
return !this.isValidDate
|
||||
public get invalidDateText(): string {
|
||||
return this.isValidDate ? "" : "Invalid date format"
|
||||
}
|
||||
|
||||
public async publishNote() {
|
||||
|
|
Loading…
Reference in New Issue