Skip to content

Commit 9cca01c

Browse files
committed
fix(ui): watch on iconSet if not set; eslint fixes
1 parent 534dd3b commit 9cca01c

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

ui/src/components/QIconPicker.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@ export default {
120120

121121
watch: {
122122
iconSet (val) {
123-
this.__loadIconSet(val)
124-
this.__updatePagination()
125-
this.$nextTick(() => {
126-
// whenever the icon set changes, it resets pagination page to page 1
127-
this.__setPagination({ page: 1 })
128-
})
129-
// scroll to top of QScrollArea, if applicable
130-
this.$refs.scrollArea.setScrollPosition(0)
123+
if (val) {
124+
this.__loadIconSet(val)
125+
this.__updatePagination()
126+
this.$nextTick(() => {
127+
// whenever the icon set changes, it resets pagination page to page 1
128+
this.__setPagination({ page: 1 })
129+
})
130+
// scroll to top of QScrollArea, if applicable
131+
this.$refs.scrollArea.setScrollPosition(0)
132+
}
131133
},
132134

133135
icons (val) {
@@ -181,10 +183,10 @@ export default {
181183
const iconsSet = window.QIconPicker.iconSet[name]
182184
this.iconsList = iconsSet.icons
183185
} else {
184-
// eslint-disable-next-line no-console
186+
/* eslint-disable */
185187
console.error(`QIconPicker: no icon set loaded called '${set}'`)
186-
// eslint-disable-next-line no-console
187188
console.error('Be sure to load the UMD version of the icon set in a script tag before using with UMD')
189+
/* eslint-enable */
188190
}
189191
} else {
190192
try {

0 commit comments

Comments
 (0)