forked from trent_larson/crowd-funder-for-time-pwa
fix: resolve SVG loading error and improve TypeScript typing
- Fix EntityIcon.vue to import blank-square.svg as module instead of using relative path - Update template to use imported SVG path for proper Electron compatibility - Make contact prop optional in EntityIcon component to fix TypeScript error - Add proper Settings type imports and method signatures in PlatformServiceMixin.ts - Replace console statements with logger calls across multiple files - Resolves SVG loading failures in Electron builds while maintaining web compatibility - Reduces TypeScript 'any' type warnings from 81 to 53
This commit is contained in:
@@ -8,10 +8,11 @@ import { avataaars } from "@dicebear/collection";
|
||||
import { Vue, Component, Prop } from "vue-facing-decorator";
|
||||
import { Contact } from "../db/tables/contacts";
|
||||
import { transformImageUrlForCors } from "../libs/util";
|
||||
import blankSquareSvg from "../assets/blank-square.svg";
|
||||
|
||||
@Component
|
||||
export default class EntityIcon extends Vue {
|
||||
@Prop contact: Contact;
|
||||
@Prop contact?: Contact;
|
||||
@Prop entityId = ""; // overridden by contact.did or profileImageUrl
|
||||
@Prop iconSize = 0;
|
||||
@Prop profileImageUrl = ""; // overridden by contact.profileImageUrl
|
||||
@@ -23,7 +24,7 @@ export default class EntityIcon extends Vue {
|
||||
} else {
|
||||
const identifier = this.contact?.did || this.entityId;
|
||||
if (!identifier) {
|
||||
return `<img src="../src/assets/blank-square.svg" class="rounded" width="${this.iconSize}" height="${this.iconSize}" />`;
|
||||
return `<img src="${blankSquareSvg}" class="rounded" width="${this.iconSize}" height="${this.iconSize}" />`;
|
||||
}
|
||||
// https://api.dicebear.com/8.x/avataaars/svg?seed=
|
||||
// ... does not render things with the same seed as this library.
|
||||
|
||||
Reference in New Issue
Block a user