From e46f915aaefaff125fb5d17537f7023df815887e Mon Sep 17 00:00:00 2001 From: wibus-wee <1596355173@qq.com> Date: Fri, 7 Jul 2023 18:26:05 +0800 Subject: [PATCH] fix: missing incoming image parameter --- addon.js | 1 + src/functions/better-image-display.ts | 2 +- types.d.ts | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/addon.js b/addon.js index 379e559..d84134b 100644 --- a/addon.js +++ b/addon.js @@ -13,6 +13,7 @@ window.onload = async function () { ...window.theme, location: decodeURIComponent(scriptElement.replace('addon.js', '').replace('file:///', '')), theme: settings.theme, + localImageViewerByDefault: settings.localImageViewerByDefault, }; document.head.appendChild(refineScript); diff --git a/src/functions/better-image-display.ts b/src/functions/better-image-display.ts index 66cdcdd..c610491 100644 --- a/src/functions/better-image-display.ts +++ b/src/functions/better-image-display.ts @@ -61,7 +61,7 @@ export function betterImageDisplay(messageUserList: IMessageUserList) { // 检查一下有没有 vac-forward-container const forwardContainer = document.querySelector(".vac-forward-container"); if (!forwardContainer) { - require("electron").ipcRenderer.send("openImage", messageImageSrc); + require("electron").ipcRenderer.send("openImage", messageImageSrc, window.theme.localImageViewerByDefault); } }; const messageCard = messageElement.querySelector( diff --git a/types.d.ts b/types.d.ts index cae4e43..0bf52a2 100644 --- a/types.d.ts +++ b/types.d.ts @@ -4,10 +4,14 @@ import { Functions, FunctionsKey } from "./src/functions" declare global { interface Window { theme: { - dev: boolean, + // Auto generated location: string, + // From settings (Auto generated) theme: "auto" | "light" | "dark", + localImageViewerByDefault: boolean, systemTheme: "light" | "dark", + // Manual control + dev: boolean, chatbox: FunctionsKey[], core: CoresKey[], manual: boolean, // 是否手动控制功能启动