Skip to content

Commit

Permalink
improvement: rearrange "realtime webxdc" setting
Browse files Browse the repository at this point in the history
Closes #4293
  • Loading branch information
WofWca committed Nov 5, 2024
1 parent 6d85829 commit 496e5ca
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
20 changes: 14 additions & 6 deletions packages/frontend/src/components/Settings/Communication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import SettingsSelector from './SettingsSelector'
import SmallSelectDialog, { SelectDialogOption } from '../SmallSelectDialog'
import useDialog from '../../hooks/dialog/useDialog'
import useTranslationFunction from '../../hooks/useTranslationFunction'
import CoreSettingsSwitch from './CoreSettingsSwitch'

function showToString(configValue: number | string) {
if (typeof configValue === 'string') configValue = Number(configValue)
Expand Down Expand Up @@ -55,11 +56,18 @@ export default function Communication({ settingsStore }: Props) {
if (!settingsStore.settings['show_emails']) return null

return (
<SettingsSelector
onClick={onOpenDialog.bind(null)}
currentValue={showToString(settingsStore.settings['show_emails'])}
>
{tx('pref_show_emails')}
</SettingsSelector>
<>
<SettingsSelector
onClick={onOpenDialog.bind(null)}
currentValue={showToString(settingsStore.settings['show_emails'])}
>
{tx('pref_show_emails')}
</SettingsSelector>
<CoreSettingsSwitch
label={tx('enable_realtime')}
settingsKey='webxdc_realtime_enabled'
description={tx('enable_realtime_explain')}
/>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ export function ExperimentalFeatures({ settingsStore }: Props) {
// 853b584251a5dacf60ebc616f7fb10edffb5c5e5/src/main/index.ts#L12-L21
description='Careful: opening developer tools on a malicious webxdc app could lead to the app getting access to the Internet'
/>
<CoreSettingsSwitch
label={tx('enable_realtime')}
settingsKey='webxdc_realtime_enabled'
description={tx('enable_realtime_explain')}
/>
{/* If this stops being experimental, add it to the
Keyboard shortcuts help (Ctrl + /), and KEYBINDINGS.md.
And don't forget about "Esc" to cancel reply */}
Expand Down

0 comments on commit 496e5ca

Please sign in to comment.