File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,13 +6,17 @@ import React from "react";
66import { errSignal , trace } from "." ;
77import { updateActivity } from "./updateActivity" ;
88
9+ const defaultCustomStatusText = "{track} by {artist}" ;
10+
911export 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+
1620export 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 ) )
You can’t perform that action at this time.
0 commit comments