Skip to content

Commit

Permalink
Fix rendering of AllowScreenSharing config setting
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Oct 31, 2024
1 parent 38125f7 commit 853843c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions e2e/tests/admin_console.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@ test.describe('admin console', () => {
// Check dropdown input
await page.getByTestId('PluginSettings.Plugins.com+mattermost+calls.recordingqualitydropdown').selectOption('High');
await expect(await resizeAndScreenshot(page, 'PluginSettings.Plugins.com+mattermost+calls.recordingquality')).toMatchSnapshot('calls-system-console-recording-quality.png');

// Ensure AllowScreenSharing defaults to true
await expect(page.getByTestId('PluginSettings.Plugins.com+mattermost+calls.allowscreensharingtrue')).toBeChecked();
await expect(page.getByTestId('PluginSettings.Plugins.com+mattermost+calls.allowscreensharingfalse')).not.toBeChecked();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export default function AllowScreenSharing(props: CustomComponentProps) {
props.onChange(props.id, e.target.value === 'true');
};

// This setting has a default of true so we need to handle the unset case.
// @ts-ignore val is a boolean, but the signature says 'string'. (being defensive here, just in case)
const checked = props.value === 'true' || props.value === true;
const checked = typeof props.value === 'undefined' || props.value === 'true' || props.value === true;

return (
<div
Expand Down

0 comments on commit 853843c

Please sign in to comment.