diff --git a/zero.Backoffice.UI/app/components/ui-iconpicker.vue b/zero.Backoffice.UI/app/components/ui-iconpicker.vue index 56d8e06b..b82e7f36 100644 --- a/zero.Backoffice.UI/app/components/ui-iconpicker.vue +++ b/zero.Backoffice.UI/app/components/ui-iconpicker.vue @@ -10,6 +10,8 @@ import { open as openOverlay } from '../services/overlay'; import { extendObject } from '../utils'; import { useUiStore } from '../ui/store'; + import * as notifications from '../services/notification'; + import { localize } from '../services/localization'; export default { name: 'uiIconpicker', @@ -87,7 +89,8 @@ loadSet() { - this.iconSet = this.store.iconSets.find(x => x.alias === this.set); + const alias = this.set || 'feather'; + this.iconSet = this.store.iconSets.find(x => x.alias === alias); }, async pick() @@ -97,6 +100,12 @@ return; } + if (!this.iconSet) + { + notifications.error("@iconpicker.notfound.title", localize("@iconpicker.notfound.text", { tokens: { name: this.set || '' } })); + return; + } + const result = await openOverlay(extendObject({ model: { set: this.iconSet, diff --git a/zero.Backoffice/Resources/Localization/zero.en-us.json b/zero.Backoffice/Resources/Localization/zero.en-us.json index fbeaedc4..63dda7d4 100644 --- a/zero.Backoffice/Resources/Localization/zero.en-us.json +++ b/zero.Backoffice/Resources/Localization/zero.en-us.json @@ -620,7 +620,11 @@ }, "iconpicker": { - "title": "Pick an icon" + "title": "Pick an icon", + "notfound": { + "title": "Icon set not found", + "text": "Could not locate a registered icon set (\"{name}\")" + } }, "colorpicker": {