Skip to content

Commit b52d7a6

Browse files
committed
Fix DiscordRPC defaultCustomStatusText
1 parent 145cd3a commit b52d7a6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

plugins/DiscordRPC/src/Settings.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ import React from "react";
66
import { errSignal, trace } from ".";
77
import { updateActivity } from "./updateActivity";
88

9+
const defaultCustomStatusText = "{track} by {artist}";
10+
911
export const settings = await ReactiveStore.getPluginStorage("DiscordRPC", {
1012
displayOnPause: true,
1113
displayArtistIcon: true,
1214
displayPlaylistButton: true,
13-
customStatusText: "Listening to {track} by {artist}",
15+
customStatusText: defaultCustomStatusText,
1416
});
1517

18+
if (!settings.customStatusText || settings.customStatusText === "") settings.customStatusText = defaultCustomStatusText;
19+
1620
export const Settings = () => {
1721
const [displayOnPause, setDisplayOnPause] = React.useState(settings.displayOnPause);
1822
const [displayArtistIcon, setDisplayArtistIcon] = React.useState(settings.displayArtistIcon);
@@ -69,12 +73,12 @@ export const Settings = () => {
6973
<li>{`{artist}`}</li>
7074
<li>{`{album}`}</li>
7175
</ul>
72-
Default: <b>{"Listening to {track} by {artist}"}</b>
76+
Default: <b>{"{track} by {artist}"}</b>
7377
</>
7478
}
7579
value={customStatusText}
7680
onChange={(e) => {
77-
if (e.target.value === "" || !e.target.value) setCustomStatusText((settings.customStatusText = "Listening to {track} by {artist}"));
81+
if (e.target.value === "" || !e.target.value) setCustomStatusText((settings.customStatusText = defaultCustomStatusText));
7882
else setCustomStatusText((settings.customStatusText = e.target.value));
7983
updateActivity()
8084
.then(() => (errSignal!._ = undefined))

0 commit comments

Comments
 (0)