Skip to content

Commit

Permalink
make watchers more failsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
borosr committed Aug 5, 2024
1 parent 4d92f12 commit e4bc370
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gwservices/fp-money",
"version": "2.0.1",
"version": "2.0.2",
"private": false,
"description": "Input formatter and currency selector",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/fp-money/component.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default defineComponent({
},
watch: {
modelValue(newValue, oldValue) {
if (!this.fpmoney || newValue.toString() === oldValue.toString()) {
if (!this.fpmoney || newValue?.toString() === oldValue?.toString()) {
return
}
this.fpmoney.setValue(newValue)
Expand All @@ -106,13 +106,13 @@ export default defineComponent({
this.fpmoney.setCurrencies(newValue)
},
currency(newValue, oldValue) {
if (!this.fpmoney || newValue.toLowerCase() === oldValue.toLowerCase()) {
if (!this.fpmoney || newValue?.toLowerCase() === oldValue?.toLowerCase()) {
return
}
this.fpmoney.setCurrency(newValue)
},
locale(newValue, oldValue) {
if (!this.fpmoney || newValue.toLowerCase() === oldValue.toLowerCase()) {
if (!this.fpmoney || newValue?.toLowerCase() === oldValue?.toLowerCase()) {
return
}
this.fpmoney.setLocale(newValue)
Expand Down

0 comments on commit e4bc370

Please sign in to comment.