Skip to content

Commit 09f9a7f

Browse files
cunoeclaude
andcommitted
fix: resolve TypeScript errors and update options redirect
- Fix autoPublish -> isAutoPublish in 7 platform sync files - Fix ArticleData.content -> htmlContent in article/juejin.ts - Fix webhook.ts content property type access - Remove deprecated index_old.tsx - Update options page to always redirect to multipost.app 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent bf4aa8a commit 09f9a7f

File tree

10 files changed

+12
-321
lines changed

10 files changed

+12
-321
lines changed

src/options/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function getShadowContainer() {
1313

1414
export const getShadowHostId = () => "test-shadow";
1515

16-
const BASE_URL = process.env.NODE_ENV === "development" ? "http://localhost:3000" : "https://multipost.app";
16+
const BASE_URL = "https://multipost.app";
1717

1818
export const getStyle = () => {
1919
const style = document.createElement("style");

src/options/index_old.tsx

Lines changed: 0 additions & 310 deletions
This file was deleted.

src/sync/article/juejin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function ArticleJuejin(data: SyncData) {
6262
cancelable: true,
6363
clipboardData: new DataTransfer(),
6464
});
65-
pasteEvent.clipboardData?.setData("text/html", articleData.content || "");
65+
pasteEvent.clipboardData?.setData("text/html", articleData.htmlContent || "");
6666
editor.dispatchEvent(pasteEvent);
6767
editor.dispatchEvent(new Event("input", { bubbles: true }));
6868
editor.dispatchEvent(new Event("change", { bubbles: true }));
@@ -77,7 +77,7 @@ export async function ArticleJuejin(data: SyncData) {
7777
console.debug("sendButton", sendButton);
7878

7979
if (sendButton) {
80-
if (data.autoPublish) {
80+
if (data.isAutoPublish) {
8181
console.debug("自动发布:点击发布按钮");
8282
sendButton.dispatchEvent(new Event("click", { bubbles: true }));
8383
} else {

src/sync/dynamic/facebook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export async function DynamicFacebook(data: SyncData) {
158158

159159
console.debug("sendButton", sendButton);
160160
if (sendButton) {
161-
if (data.autoPublish) {
161+
if (data.isAutoPublish) {
162162
console.debug("自动发布:点击发布按钮");
163163
sendButton.dispatchEvent(new Event("click", { bubbles: true }));
164164
} else {

src/sync/dynamic/instagram.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export async function DynamicInstagram(data: SyncData) {
189189
return;
190190
}
191191

192-
if (data.autoPublish) {
192+
if (data.isAutoPublish) {
193193
console.debug("自动发布:点击分享按钮");
194194
shareButton.dispatchEvent(new Event("click", { bubbles: true }));
195195
} else {

src/sync/dynamic/juejin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export async function DynamicJuejin(data: SyncData) {
8989
}
9090

9191
// 查找发布按钮
92-
if (data.autoPublish) {
92+
if (data.isAutoPublish) {
9393
const buttons = document.querySelectorAll("button");
9494
console.debug("buttons", buttons);
9595
const sendButton = Array.from(buttons).find((btn) => btn.textContent?.includes("发布"));

src/sync/dynamic/linkedin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export async function DynamicLinkedin(data: SyncData) {
116116
const sendButton = document.querySelector("button.share-actions__primary-action") as HTMLButtonElement;
117117
console.debug("sendButton", sendButton);
118118
if (sendButton) {
119-
if (data.autoPublish) {
119+
if (data.isAutoPublish) {
120120
console.debug("自动发布:点击发布按钮");
121121
sendButton.click();
122122
} else {

src/sync/dynamic/maimai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export async function DynamicMaimai(data: SyncData) {
120120
console.debug("sendButton", sendButton);
121121

122122
if (sendButton) {
123-
if (data.autoPublish) {
123+
if (data.isAutoPublish) {
124124
console.debug("自动发布:点击发布按钮");
125125
sendButton.dispatchEvent(new Event("click", { bubbles: true }));
126126
} else {

src/sync/dynamic/reddit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export async function DynamicReddit(data: SyncData) {
116116
}
117117

118118
// 自动提交
119-
if (data.autoPublish) {
119+
if (data.isAutoPublish) {
120120
await new Promise((resolve) => setTimeout(resolve, 5000));
121121

122122
const submitButton = document.querySelector("r-post-form-submit-button#submit-post-button");

0 commit comments

Comments
 (0)