diff --git a/src/plugins/rpcEditor/ReplaceSettings.tsx b/src/plugins/rpcEditor/ReplaceSettings.tsx index e8ba60403..c0414fc97 100644 --- a/src/plugins/rpcEditor/ReplaceSettings.tsx +++ b/src/plugins/rpcEditor/ReplaceSettings.tsx @@ -153,40 +153,56 @@ export function ReplaceSettings({ appIds, update, save }: SettingsProps) { onChange(v, i, "newState"); }} /> - Large image - Text {setting.newActivityType !== ActivityType.PLAYING && "(also third line)"} - { - onChange(v, i, "newLargeImageText"); + { + !setting.disableAssets && + <> + Large image + Text {setting.newActivityType !== ActivityType.PLAYING && "(also third line)"} + { + onChange(v, i, "newLargeImageText"); + }} + /> + URL + { + onChange(v, i, "newLargeImageUrl"); + }} + /> + Small image + Text + { + onChange(v, i, "newSmallImageText"); + }} + /> + URL + { + onChange(v, i, "newSmallImageUrl"); + }} + /> + + } + { + onChange(value, i, "disableAssets"); }} - /> - URL - { - onChange(v, i, "newLargeImageUrl"); - }} - /> - Small image - Text - { - onChange(v, i, "newSmallImageText"); - }} - /> - URL - { - onChange(v, i, "newSmallImageUrl"); - }} - /> + hideBorder={true} + style={{ marginBottom: "0" }} + > + Hide assets (large & small images) + { diff --git a/src/plugins/rpcEditor/index.tsx b/src/plugins/rpcEditor/index.tsx index 7f0d33b99..4ea978230 100644 --- a/src/plugins/rpcEditor/index.tsx +++ b/src/plugins/rpcEditor/index.tsx @@ -16,6 +16,7 @@ import { parse } from "path"; const APP_IDS_KEY = "ReplaceActivityType_appids"; export type AppIdSetting = { + disableAssets: boolean; disableTimestamps: boolean; appId: string; enabled: boolean; @@ -76,7 +77,8 @@ export const makeEmptyAppId: () => AppIdSetting = () => ({ newSmallImageUrl: "", newSmallImageText: "", newStreamUrl: "", - disableTimestamps: false + disableTimestamps: false, + disableAssets: false }); let appIds = [makeEmptyAppId()]; @@ -144,6 +146,8 @@ export default definePlugin({ if (app.newLargeImageUrl) activity.assets.large_image = this.parseField(app.newLargeImageUrl, oldActivity); if (app.newSmallImageText) activity.assets.small_text = this.parseField(app.newSmallImageText, oldActivity); if (app.newSmallImageUrl) activity.assets.small_image = this.parseField(app.newSmallImageUrl, oldActivity); + // @ts-ignore here we are intentionally nulling assets + if (app.disableAssets) activity.assets = {}; if (app.disableTimestamps) activity.timestamps = {}; } });