Skip to content

Commit

Permalink
fix: missing incoming image parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Jul 7, 2023
1 parent f2647d4 commit e46f915
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/functions/better-image-display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 5 additions & 1 deletion types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, // 是否手动控制功能启动
Expand Down

0 comments on commit e46f915

Please sign in to comment.