Skip to content

Commit

Permalink
adds comment for useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
MGJamJam committed Apr 4, 2024
1 parent b04010d commit e8a55bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bitmovin-analytics-datasource/src/components/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ interface Props extends DataSourcePluginOptionsEditorProps<MyDataSourceOptions>
export function ConfigEditor(props: Props) {
const { onOptionsChange, options } = props;

// sets the instanceSettings.url to the default bitmovin api url if it is not already set when opening the ConfigEditor
useEffect(() => {
if (options.url === '' || options.url == null) {
onOptionsChange({ ...options, url: 'https://api.bitmovin.com/v1' });
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

const onAdAnalyticsChange = (event: ChangeEvent<HTMLInputElement>) => {
Expand Down

0 comments on commit e8a55bc

Please sign in to comment.