Skip to content

Commit

Permalink
fix(settings): reactivity of "confirm title" needs to use Realm hook (#…
Browse files Browse the repository at this point in the history
…4913)

* fix(settings): reactivity of "confirm title" needs to use Realm hook

* chore: remove logging, add comment about unused

* refactor: remove braces
  • Loading branch information
blackxored authored Mar 22, 2024
1 parent 3377d7b commit 10d88fb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/components-react/windows/settings/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import fs from 'fs';
import path from 'path';
import { getDefined } from '../../../util/properties-type-guards';
import { useVuex } from 'components-react/hooks';
import { useRealmObject } from 'components-react/hooks/realm';

export function GeneralSettings() {
return (
Expand Down Expand Up @@ -61,18 +62,15 @@ function ExtraSettings() {
const disableHAFilePath = path.join(AppService.appDataDirectory, 'HADisable');
const [disableHA, setDisableHA] = useState(() => fs.existsSync(disableHAFilePath));

const {
isRecordingOrStreaming,
recordingMode,
updateStreamInfoOnLive,
isSimpleOutputMode,
} = useVuex(() => ({
// TODO: unused fields
const { isRecordingOrStreaming, recordingMode, isSimpleOutputMode } = useVuex(() => ({
isRecordingOrStreaming: StreamingService.isStreaming || StreamingService.isRecording,
recordingMode: RecordingModeService.views.isRecordingModeEnabled,
updateStreamInfoOnLive: CustomizationService.state.updateStreamInfoOnLive,
isSimpleOutputMode: SettingsService.views.isSimpleOutputMode,
}));

const updateStreamInfoOnLive = useRealmObject(CustomizationService.state).updateStreamInfoOnLive;

// HDR Settings are not compliant with the auto-optimizer
// temporarily disable auto config until migrate to new api
const canRunOptimizer = false;
Expand Down Expand Up @@ -126,7 +124,7 @@ function ExtraSettings() {
{isLoggedIn && !isFacebook && !isYoutube && (
<CheckboxInput
value={updateStreamInfoOnLive}
onChange={val => CustomizationService.setUpdateStreamInfoOnLive(val)}
onChange={val => CustomizationService.actions.setUpdateStreamInfoOnLive(val)}
label={$t('Confirm stream title and game before going live')}
name="stream_info_udpate"
/>
Expand Down

0 comments on commit 10d88fb

Please sign in to comment.