mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
thanks discord [support changing listen type]
This commit is contained in:
parent
284db988c9
commit
906ffee8bc
4 changed files with 35 additions and 2 deletions
|
|
@ -45,7 +45,7 @@ export const useDiscordRpc = () => {
|
|||
state: (artists && `By ${artists}`) || 'Unknown artist',
|
||||
// I would love to use the actual type as opposed to hardcoding to 2,
|
||||
// but manually installing the discord-types package appears to break things
|
||||
type: 2,
|
||||
type: discordSettings.showAsListening ? 2 : 0,
|
||||
};
|
||||
|
||||
if (currentStatus === PlayerStatus.PLAYING) {
|
||||
|
|
@ -73,7 +73,13 @@ export const useDiscordRpc = () => {
|
|||
}
|
||||
|
||||
discordRpc?.setActivity(activity);
|
||||
}, [currentSong, currentStatus, discordSettings.enableIdle, discordSettings.showServerImage]);
|
||||
}, [
|
||||
currentSong,
|
||||
currentStatus,
|
||||
discordSettings.enableIdle,
|
||||
discordSettings.showAsListening,
|
||||
discordSettings.showServerImage,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
const initializeDiscordRpc = async () => {
|
||||
|
|
|
|||
|
|
@ -119,6 +119,29 @@ export const DiscordSettings = () => {
|
|||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
{
|
||||
control: (
|
||||
<Switch
|
||||
checked={settings.showAsListening}
|
||||
onChange={(e) => {
|
||||
setSettings({
|
||||
discord: {
|
||||
...settings,
|
||||
showAsListening: e.currentTarget.checked,
|
||||
},
|
||||
});
|
||||
}}
|
||||
/>
|
||||
),
|
||||
description: t('setting.discordListening', {
|
||||
context: 'description',
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
isHidden: !isElectron(),
|
||||
title: t('setting.discordListening', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
return <SettingsSection options={discordOptions} />;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue