diff --git a/.vscode/settings.json b/.vscode/settings.json index 107d991..3bffe27 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,23 +1,9 @@ { - "typescript.preferences.importModuleSpecifier": "non-relative", + "workbench.colorTheme": "Monokai", "workbench.colorCustomizations": { - "activityBar.activeBackground": "#ab307e", - "activityBar.background": "#ab307e", - "activityBar.foreground": "#e7e7e7", - "activityBar.inactiveForeground": "#e7e7e799", - "activityBarBadge.background": "#25320e", - "activityBarBadge.foreground": "#e7e7e7", - "commandCenter.border": "#e7e7e799", - "sash.hoverBorder": "#ab307e", - "statusBar.background": "#832561", - "statusBar.foreground": "#e7e7e7", - "statusBarItem.hoverBackground": "#ab307e", - "statusBarItem.remoteBackground": "#832561", - "statusBarItem.remoteForeground": "#e7e7e7", - "titleBar.activeBackground": "#832561", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveBackground": "#83256199", - "titleBar.inactiveForeground": "#e7e7e799" + "titleBar.activeBackground": "#059212", + "titleBar.activeForeground": "#FFFFFF", + "activityBar.background": "#059212", + "activityBar.foreground": "#FFFFFF" }, - "peacock.color": "#832561" } \ No newline at end of file diff --git a/src/lib/MainContent.ts b/src/lib/MainContent.ts index c1462ca..1b7613a 100644 --- a/src/lib/MainContent.ts +++ b/src/lib/MainContent.ts @@ -108,15 +108,24 @@ const postToMastodon = async (text: string, images: string[]): Promise } })(); - const res = await fetch(`https://${MASTODON_HOST}/api/v1/statuses`, { + // const res = await fetch(`https://${MASTODON_HOST}/api/v1/statuses`, { + // method: 'POST', + // headers: { + // 'Authorization': `Bearer ${ACCESS_TOKEN}`, + // 'Content-Type': 'application/json', + // }, + // body: JSON.stringify({ status, media_ids }), + // }); + + const res = await fetch(`${Config.API_ENDPOINT}/mastodon_post`, { method: 'POST', headers: { - 'Authorization': `Bearer ${ACCESS_TOKEN}`, - 'Content-Type': 'application/json', + 'Content-Type': 'text/plain', }, - body: JSON.stringify({ status, media_ids }), + body: JSON.stringify({ host: MASTODON_HOST, token: settings.token_data.access_token, status, media_ids }), }); + if (res.ok) { } else { return false;