@politicalwatch/tipi-uikit 1.6.5 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@politicalwatch/tipi-uikit",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "main": "src/components/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -16,6 +16,7 @@ export default {
16
16
  },
17
17
  data: function () {
18
18
  return {
19
+ icons: import.meta.glob(`../../assets/party_logos/icon/*.svg`),
19
20
  parties: {
20
21
  Cs: {
21
22
  name: 'Ciudadanos',
@@ -177,17 +178,10 @@ export default {
177
178
  },
178
179
  computed: {
179
180
  svg() {
180
- let svg = '';
181
- try {
182
- if (this.party in this.parties) {
183
- svg = defineAsyncComponent(() =>
184
- import(`../../assets/party_logos/icon/${this.parties[this.party].logo}.svg`)
185
- );
186
- } else {
187
- svg = defineAsyncComponent(() => import('../../assets/svg/icon-error.svg'));
188
- }
189
- } catch (error) {
190
- svg = this.icon;
181
+ if (this.party in this.parties) {
182
+ svg = defineAsyncComponent(() => this.icons[`${this.parties[this.party].logo}.svg`]());
183
+ } else {
184
+ svg = defineAsyncComponent(() => import('../../assets/svg/icon-error.svg'));
191
185
  }
192
186
  return svg;
193
187
  },