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:
Matthew Raymer
2025-07-03 10:03:58 +00:00
parent f06b6aa367
commit f839b65c56
5 changed files with 114 additions and 33 deletions

View File

@@ -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.