Skip to content

Commit 91bd9f0

Browse files
author
Akos Kitta
committed
Fixed bug when no 3rd party URLs are defined.
Instead of adding an empty string URL, we add nothing. Signed-off-by: Akos Kitta <[email protected]>
1 parent 8caa627 commit 91bd9f0

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Diff for: arduino-ide-extension/src/browser/settings.tsx

+17-17
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface Settings extends Index {
2424
editorFontSize: number; // `editor.fontSize`
2525
themeId: string; // `workbench.colorTheme`
2626
autoSave: 'on' | 'off'; // `editor.autoSave`
27-
quickSuggestions: Record<'other'|'comments'|'strings', boolean>; // `editor.quickSuggestions`
27+
quickSuggestions: Record<'other' | 'comments' | 'strings', boolean>; // `editor.quickSuggestions`
2828

2929
autoScaleInterface: boolean; // `arduino.window.autoScale`
3030
interfaceScale: number; // `arduino.window.zoomLevel` https://github.com/eclipse-theia/theia/issues/8751
@@ -100,9 +100,9 @@ export class SettingsService {
100100
this.preferenceService.get<string>('workbench.colorTheme', 'arduino-theme'),
101101
this.preferenceService.get<'on' | 'off'>('editor.autoSave', 'on'),
102102
this.preferenceService.get<object>('editor.quickSuggestion', {
103-
'other': false,
104-
'comments': false,
105-
'strings': false
103+
'other': false,
104+
'comments': false,
105+
'strings': false
106106
}),
107107
this.preferenceService.get<boolean>('arduino.window.autoScale', true),
108108
this.preferenceService.get<number>('arduino.window.zoomLevel', 0),
@@ -569,18 +569,18 @@ export class SettingsComponent extends React.Component<SettingsComponent.Props,
569569
};
570570

571571
protected quickSuggestionsOtherDidChange = (event: React.ChangeEvent<HTMLInputElement>) => {
572-
573-
// need to persist react events through lifecycle https://reactjs.org/docs/events.html#event-pooling
574-
const newVal = event.target.checked ? true : false
575-
576-
this.setState(prevState => {
577-
return {
578-
quickSuggestions: {
579-
...prevState.quickSuggestions,
580-
other: newVal
581-
}
582-
}
583-
});
572+
573+
// need to persist react events through lifecycle https://reactjs.org/docs/events.html#event-pooling
574+
const newVal = event.target.checked ? true : false
575+
576+
this.setState(prevState => {
577+
return {
578+
quickSuggestions: {
579+
...prevState.quickSuggestions,
580+
other: newVal
581+
}
582+
}
583+
});
584584
};
585585

586586
protected themeDidChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
@@ -823,7 +823,7 @@ export class AdditionalUrlsDialog extends AbstractDialog<string[]> {
823823
}
824824

825825
get value(): string[] {
826-
return this.textArea.value.split('\n').map(url => url.trim());
826+
return this.textArea.value.split('\n').map(url => url.trim()).filter(url => !!url);
827827
}
828828

829829
protected onAfterAttach(message: Message): void {

0 commit comments

Comments
 (0)