Skip to content

Commit

Permalink
add unregister callback
Browse files Browse the repository at this point in the history
  • Loading branch information
SheffeyG committed Dec 11, 2023
1 parent d1d1be2 commit ae8a793
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/views/GameSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const GameSettings: VFC<{ appid: number }> = ({ appid }) => {

useEffect(() => {
let savedOptions = '';
SteamClient.Apps.RegisterForAppDetails(appid, (detail: AppDetails) => {
const unregister = SteamClient.Apps.RegisterForAppDetails(appid, (detail: AppDetails) => {
savedOptions = detail.strLaunchOptions;
const matchCheat = savedOptions.match(/PROTON_REMOTE_DEBUG_CMD="([^"]*)"/);
const matchLang = savedOptions.match(/LANG="([^"]*)"/);
Expand All @@ -35,6 +35,7 @@ const GameSettings: VFC<{ appid: number }> = ({ appid }) => {
}
setGameSettings(updatedGameSettings);
})
setTimeout(() => { unregister() }, 1000);
}, []);

const handleBrowse = async () => {
Expand Down

0 comments on commit ae8a793

Please sign in to comment.