refactor(ui): remove unused image cache system and fix TypeScript compilation

- Remove imageCache Map that only stored null values
- Remove selectedImageData Blob property (never used)
- Remove cacheImageData method and related function props
- Remove handleImageLoad method from ActivityListItem
- Clean up ImageViewer component props
- Fix TypeScript compilation by replacing legacy logConsoleAndDb calls
- Replace logConsoleAndDb with logger.error in deepLinks service
- Images continue to work via direct URL references

The image cache system was non-functional and only stored null values.
ImageViewer component ignored blob data and only used URLs.
Fixed production build failure caused by undefined logConsoleAndDb function.
Removing dead code improves maintainability without affecting functionality.
This commit is contained in:
Matthew Raymer
2025-08-12 08:45:08 +00:00
parent 2afe61d752
commit bb357f294a
4 changed files with 5 additions and 49 deletions

View File

@@ -234,7 +234,6 @@ Raymer * @version 1.0.0 */
:last-viewed-claim-id="feedLastViewedClaimId"
:is-registered="isRegistered"
:active-did="activeDid"
:on-image-cache="cacheImageData"
@load-claim="onClickLoadClaim"
@view-image="openImageViewer"
/>
@@ -255,11 +254,7 @@ Raymer * @version 1.0.0 */
<ChoiceButtonDialog ref="choiceButtonDialog" />
<ImageViewer
v-model:is-open="isImageViewerOpen"
:image-url="selectedImage"
:image-data="selectedImageData"
/>
<ImageViewer v-model:is-open="isImageViewerOpen" :image-url="selectedImage" />
</template>
<script lang="ts">
@@ -434,9 +429,7 @@ export default class HomeView extends Vue {
showShortcutBvc = false;
userAgentInfo = new UAParser(); // see https://docs.uaparser.js.org/v2/api/ua-parser-js/get-os.html
selectedImage = "";
selectedImageData: Blob | null = null;
isImageViewerOpen = false;
imageCache: Map<string, Blob | null> = new Map();
showProjectsDialog = false;
/**
@@ -1614,23 +1607,6 @@ export default class HomeView extends Vue {
});
}
/**
* Caches image data for sharing
*
* @public
* Called by ActivityListItem component function prop
* @param imageUrl URL of image to cache
*/
async cacheImageData(imageUrl: string) {
try {
// For images that might fail CORS, just store the URL
// The Web Share API will handle sharing the URL appropriately
this.imageCache.set(imageUrl, null);
} catch (error) {
logger.warn("Failed to cache image:", error);
}
}
/**
* Opens image viewer dialog
*
@@ -1639,7 +1615,6 @@ export default class HomeView extends Vue {
* @param imageUrl URL of image to display
*/
async openImageViewer(imageUrl: string) {
this.selectedImageData = this.imageCache.get(imageUrl) ?? null;
this.selectedImage = imageUrl;
this.isImageViewerOpen = true;
}