icon picker error for missing sets
This commit is contained in:
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user