Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions apps/webapp/src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1728,12 +1728,6 @@
"preferencesOptionsEmojiReplaceDetail": ":-) → [icon]",
"preferencesOptionsEnableAgcCheckbox": "Automatic gain control (AGC)",
"preferencesOptionsEnableAgcDetails": "Enable to allow your microphone volume to be adjusted automatically to ensure all participants in a call are heard with similar and comfortable loudness.",
"preferencesOptionsEnableHardwareAcceleration": "Hardware acceleration",
"preferencesOptionsEnableHardwareAccelerationDetails": "This improves stability and video performance while reducing CPU usage. If you change the setting, you need to restart the app.",
"preferencesOptionsEnableHardwareAccelerationModalCancel": "Cancel",
"preferencesOptionsEnableHardwareAccelerationModalMessage": "To update the hardware acceleration setting, you need to restart the app.",
"preferencesOptionsEnableHardwareAccelerationModalOk": "Restart App",
"preferencesOptionsEnableHardwareAccelerationModalTitle": "Restart app",
"preferencesOptionsEnablePressSpaceToUnmute": "Unmute with space bar",
"preferencesOptionsEnablePressSpaceToUnmuteDetails": "Enable to unmute your microphone by pressing and holding the space bar as long as you want to speak. You can use this option in full view.",
"preferencesOptionsEnableSoundlessIncomingCalls": "Silence other calls",
Expand Down
8 changes: 1 addition & 7 deletions apps/webapp/src/script/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {Runtime} from '@wireapp/commons';
import {createUuid} from 'Util/uuid';

import packageJson from '../../package.json';

const env = window.wire.env;

export const ACCENT_ID = {
Expand Down Expand Up @@ -121,13 +122,6 @@ const Config = {

return window.desktopAppConfig;
},
getDesktopSettings: () => {
if (!Runtime.isDesktopApp()) {
return undefined;
}

return window.desktopAppSettings;
},
};

export {Config};
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ import {ChangeEvent, useCallback, useEffect, useRef, useState} from 'react';
import type {WebappProperties} from '@wireapp/api-client/lib/user/data/';
import {amplify} from 'amplify';

import {Runtime} from '@wireapp/commons';
import {Checkbox, CheckboxLabel} from '@wireapp/react-ui-kit';
import {WebAppEvents} from '@wireapp/webapp-events';

import {PrimaryModal} from 'Components/Modals/PrimaryModal';
import type {MediaConstraintsHandler} from 'Repositories/media/MediaConstraintsHandler';
import type {PropertiesRepository} from 'Repositories/properties/propertiesRepository';
import {PROPERTIES_TYPE} from 'Repositories/properties/propertiesType';
Expand Down Expand Up @@ -56,20 +54,6 @@ const CallOptions = ({constraintsHandler, propertiesRepository}: CallOptionsProp
!!propertiesRepository.properties.settings.call.enable_press_space_to_unmute,
);

const hardwareAccelerationDescriptionId = 'status-preference-hardware-acceleration-description';

const desktopSettings = Config.getDesktopSettings();

const isHardwareAccelerationChangeable = Runtime.isDesktopApp() && !!desktopSettings;

const [isHardwareAccelerationEnabled, setIsHardwareAccelerationEnabled] = useState<boolean>(() => {
if (!isHardwareAccelerationChangeable) {
return true; // default in browser (but not changeable)
}

return desktopSettings.isHardwareAccelerationEnabled();
});

useEffect(() => {
const updateProperties = ({settings}: WebappProperties) => {
setVbrEncoding(!isCbrEncodingEnforced && settings.call.enable_vbr_encoding);
Expand Down Expand Up @@ -118,33 +102,6 @@ const CallOptions = ({constraintsHandler, propertiesRepository}: CallOptionsProp
[propertiesRepository],
);

const showHardwareAccelerationRestartModal = () => {
PrimaryModal.show(PrimaryModal.type.CONFIRM, {
size: 'large',
primaryAction: {
action: confirmHardwareAccelerationChange,
text: t('preferencesOptionsEnableHardwareAccelerationModalOk'),
},
text: {
message: t('preferencesOptionsEnableHardwareAccelerationModalMessage'),
title: t('preferencesOptionsEnableHardwareAccelerationModalTitle'),
},
});
};

const confirmHardwareAccelerationChange = () => {
if (!desktopSettings) {
return;
}

const currentHwValue = desktopSettings.isHardwareAccelerationEnabled();

desktopSettings.setHardwareAccelerationEnabled(!currentHwValue);
setIsHardwareAccelerationEnabled(!currentHwValue);

amplify.publish(WebAppEvents.LIFECYCLE.RESTART);
};

return (
<PreferencesSection title={t('preferencesOptionsCall')}>
<div>
Expand Down Expand Up @@ -196,25 +153,6 @@ const CallOptions = ({constraintsHandler, propertiesRepository}: CallOptionsProp
</p>
</div>
)}

{isHardwareAccelerationChangeable && (
<div className="checkbox-margin">
<Checkbox
onChange={showHardwareAccelerationRestartModal}
checked={isHardwareAccelerationEnabled}
id="status-preference-hardware-acceleration"
data-uie-name="status-preference-hardware-acceleration"
aria-describedby={hardwareAccelerationDescriptionId}
>
<CheckboxLabel htmlFor="status-preference-hardware-acceleration">
{t('preferencesOptionsEnableHardwareAcceleration')}
</CheckboxLabel>
</Checkbox>
<p id={hardwareAccelerationDescriptionId} className="preferences-detail preferences-detail-intended">
{t('preferencesOptionsEnableHardwareAccelerationDetails')}
</p>
</div>
)}
</PreferencesSection>
);
};
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ declare global {
interface Window {
openGraphAsync?: (url: string) => Promise<OpenGraphResult>;
desktopAppConfig?: {version: string; supportsCallingPopoutWindow?: boolean};
desktopAppSettings?: {
setHardwareAccelerationEnabled: (enabled: boolean) => void;
isHardwareAccelerationEnabled: () => boolean;
};
}
}
const logger = getLogger('LinkPreviewRepository');
Expand Down
6 changes: 0 additions & 6 deletions apps/webapp/src/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1732,12 +1732,6 @@ declare module 'I18n/en-US.json' {
'preferencesOptionsEmojiReplaceDetail': `:-) → [icon]`;
'preferencesOptionsEnableAgcCheckbox': `Automatic gain control (AGC)`;
'preferencesOptionsEnableAgcDetails': `Enable to allow your microphone volume to be adjusted automatically to ensure all participants in a call are heard with similar and comfortable loudness.`;
'preferencesOptionsEnableHardwareAcceleration': `Hardware acceleration`;
'preferencesOptionsEnableHardwareAccelerationDetails': `This improves stability and video performance while reducing CPU usage. If you change the setting, you need to restart the app.`;
'preferencesOptionsEnableHardwareAccelerationModalCancel': `Cancel`;
'preferencesOptionsEnableHardwareAccelerationModalMessage': `To update the hardware acceleration setting, you need to restart the app.`;
'preferencesOptionsEnableHardwareAccelerationModalOk': `Restart App`;
'preferencesOptionsEnableHardwareAccelerationModalTitle': `Restart app`;
'preferencesOptionsEnablePressSpaceToUnmute': `Unmute with space bar`;
'preferencesOptionsEnablePressSpaceToUnmuteDetails': `Enable to unmute your microphone by pressing and holding the space bar as long as you want to speak. You can use this option in full view.`;
'preferencesOptionsEnableSoundlessIncomingCalls': `Silence other calls`;
Expand Down
Loading