icon picker error for missing sets

This commit is contained in:
2022-01-13 15:38:28 +01:00
parent 46de63c4e2
commit 7d3ae09cec
2 changed files with 15 additions and 2 deletions
@@ -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,
@@ -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": {