diff --git a/materialious/electron/package-lock.json b/materialious/electron/package-lock.json index 1081eca8..6564b0ba 100644 --- a/materialious/electron/package-lock.json +++ b/materialious/electron/package-lock.json @@ -1,17 +1,17 @@ { "name": "Materialious", - "version": "1.8.10", + "version": "1.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "Materialious", - "version": "1.8.10", + "version": "1.9.0", "license": "MIT", "dependencies": { "@capacitor-community/electron": "^5.0.0", "bgutils-js": "^3.2.0", - "capacitor-nodejs": "https://github.com/EdenwareApps/Capacitor-NodeJS/releases/download/v1.0.0-beta.7/capacitor6-nodejs.tgz", + "capacitor-nodejs": "https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.8/capacitor-nodejs.tgz", "chokidar": "~4.0.3", "electron-is-dev": "~2.0.0", "electron-serve": "~1.1.0", @@ -1799,10 +1799,13 @@ } }, "node_modules/capacitor-nodejs": { - "version": "1.0.0-beta.7", - "resolved": "https://github.com/EdenwareApps/Capacitor-NodeJS/releases/download/v1.0.0-beta.7/capacitor6-nodejs.tgz", - "integrity": "sha512-7NwSMxE06nqpuFKyQlt3mWo+VG6Od0d6PBxPKVyPmaptE6sSoimzU/uzQXPWoHV5bwbjgcF+R0BSJAZAyy4gsg==", + "version": "1.0.0-beta.8", + "resolved": "https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.8/capacitor-nodejs.tgz", + "integrity": "sha512-VAMCTBqz+sA3762kFhSyzXS0unm0EpsVSHLmDYsTYPTiXXZaFcGk27vfXakRyyXJexAUG2Y5rZka5BvH6EmeZw==", "license": "MIT", + "engines": { + "node": ">=20.10" + }, "peerDependencies": { "@capacitor/core": "^6.0.0" } diff --git a/materialious/electron/package.json b/materialious/electron/package.json index ed774a7e..f9990e30 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -24,7 +24,7 @@ "dependencies": { "@capacitor-community/electron": "^5.0.0", "bgutils-js": "^3.2.0", - "capacitor-nodejs": "https://github.com/EdenwareApps/Capacitor-NodeJS/releases/download/v1.0.0-beta.7/capacitor6-nodejs.tgz", + "capacitor-nodejs": "https://github.com/hampoelz/capacitor-nodejs/releases/download/v1.0.0-beta.8/capacitor-nodejs.tgz", "chokidar": "~4.0.3", "electron-is-dev": "~2.0.0", "electron-serve": "~1.1.0", @@ -44,4 +44,4 @@ "capacitor", "electron" ] -} \ No newline at end of file +} diff --git a/materialious/src/lib/components/ChannelThumbnail.svelte b/materialious/src/lib/components/ChannelThumbnail.svelte index 0d8addc1..0ee518f5 100644 --- a/materialious/src/lib/components/ChannelThumbnail.svelte +++ b/materialious/src/lib/components/ChannelThumbnail.svelte @@ -5,7 +5,7 @@ import { _ } from 'svelte-i18n'; import { get } from 'svelte/store'; import type { Channel } from '../api/model'; - import { truncate } from '../misc'; + import { insecureRequestImageHandler, truncate } from '../misc'; import { interfaceLowBandwidthMode } from '../store'; interface Props { @@ -19,9 +19,9 @@ onMount(async () => { if (get(interfaceLowBandwidthMode)) return; - const img = new Image(); - img.src = proxyGoogleImage(getBestThumbnail(channel.authorThumbnails)); - + const img = await insecureRequestImageHandler( + proxyGoogleImage(getBestThumbnail(channel.authorThumbnails)) + ); img.onload = () => { channelPfp = img; }; diff --git a/materialious/src/lib/components/Comment.svelte b/materialious/src/lib/components/Comment.svelte index 2f3dc9ad..c275d7eb 100644 --- a/materialious/src/lib/components/Comment.svelte +++ b/materialious/src/lib/components/Comment.svelte @@ -4,7 +4,9 @@ import { getBestThumbnail, proxyGoogleImage } from '$lib/images'; import { numberWithCommas } from '$lib/numbers'; import { interfaceLowBandwidthMode } from '$lib/store'; + import { onMount } from 'svelte'; import CommentSelf from './Comment.svelte'; + import { insecureRequestImageHandler } from '$lib/misc'; interface Props { comment: Comment; @@ -36,16 +38,28 @@ return processedHtml; } + + let userPfp = $state(''); + onMount(async () => { + if ($interfaceLowBandwidthMode) return; + const img = await insecureRequestImageHandler( + proxyGoogleImage(getBestThumbnail(comment.authorThumbnails)) + ); + + img.onload = () => { + userPfp = img.src; + }; + });