forked from Heroic-Games-Launcher/HeroicGamesLauncher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Improv]: Add opt out of playtime tracking (Heroic-Games-Launcher#3002)
* improv: stop registering playtime on suspend, add option to disable playtime tracking * generate i18n * Update src/backend/main.ts Co-authored-by: Ariel Juodziukynas <[email protected]> * improv: add help, respect disable sync for pulling game time * rollback suspend changes * avoid confusing log messages for playtime sync --------- Co-authored-by: Ariel Juodziukynas <[email protected]>
- Loading branch information
Showing
7 changed files
with
77 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useContext } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import { ToggleSwitch } from 'frontend/components/UI' | ||
import useSetting from 'frontend/hooks/useSetting' | ||
import SettingsContext from '../SettingsContext' | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { faCircleInfo } from '@fortawesome/free-solid-svg-icons' | ||
|
||
const PlaytimeSync = () => { | ||
const { t } = useTranslation() | ||
const { isDefault } = useContext(SettingsContext) | ||
const [disablePlaytimeSync, setDisablePlaytimeSync] = useSetting( | ||
'disablePlaytimeSync', | ||
false | ||
) | ||
|
||
if (!isDefault) { | ||
return <></> | ||
} | ||
|
||
return ( | ||
<div className="toggleRow"> | ||
<ToggleSwitch | ||
htmlId="disablePlaytimeSync" | ||
value={disablePlaytimeSync} | ||
handleChange={() => setDisablePlaytimeSync(!disablePlaytimeSync)} | ||
title={t( | ||
'setting.disablePlaytimeSync', | ||
'Disable playtime synchronization' | ||
)} | ||
/> | ||
<FontAwesomeIcon | ||
className="helpIcon" | ||
icon={faCircleInfo} | ||
title={t( | ||
'help.disablePlaytimeSync', | ||
"Disables playtime synchronization with given store's servers (currently only GOG is supported)" | ||
)} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
export default PlaytimeSync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters