From f106c97f1ecb08f410d4a009d7485dd2e3cc3435 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Mon, 29 Mar 2021 13:07:27 +0200 Subject: [PATCH] Fixed bug when no 3rd party URLs are defined. Instead of adding an empty string URL, we add nothing. Signed-off-by: Akos Kitta --- .../src/browser/settings.tsx | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/arduino-ide-extension/src/browser/settings.tsx b/arduino-ide-extension/src/browser/settings.tsx index 6db428ddb..8650a7137 100644 --- a/arduino-ide-extension/src/browser/settings.tsx +++ b/arduino-ide-extension/src/browser/settings.tsx @@ -24,7 +24,7 @@ export interface Settings extends Index { editorFontSize: number; // `editor.fontSize` themeId: string; // `workbench.colorTheme` autoSave: 'on' | 'off'; // `editor.autoSave` - quickSuggestions: Record<'other'|'comments'|'strings', boolean>; // `editor.quickSuggestions` + quickSuggestions: Record<'other' | 'comments' | 'strings', boolean>; // `editor.quickSuggestions` autoScaleInterface: boolean; // `arduino.window.autoScale` interfaceScale: number; // `arduino.window.zoomLevel` https://github.com/eclipse-theia/theia/issues/8751 @@ -100,9 +100,9 @@ export class SettingsService { this.preferenceService.get('workbench.colorTheme', 'arduino-theme'), this.preferenceService.get<'on' | 'off'>('editor.autoSave', 'on'), this.preferenceService.get('editor.quickSuggestion', { - 'other': false, - 'comments': false, - 'strings': false + 'other': false, + 'comments': false, + 'strings': false }), this.preferenceService.get('arduino.window.autoScale', true), this.preferenceService.get('arduino.window.zoomLevel', 0), @@ -569,18 +569,18 @@ export class SettingsComponent extends React.Component) => { - - // need to persist react events through lifecycle https://reactjs.org/docs/events.html#event-pooling - const newVal = event.target.checked ? true : false - - this.setState(prevState => { - return { - quickSuggestions: { - ...prevState.quickSuggestions, - other: newVal - } - } - }); + + // need to persist react events through lifecycle https://reactjs.org/docs/events.html#event-pooling + const newVal = event.target.checked ? true : false + + this.setState(prevState => { + return { + quickSuggestions: { + ...prevState.quickSuggestions, + other: newVal + } + } + }); }; protected themeDidChange = (event: React.ChangeEvent) => { @@ -823,7 +823,7 @@ export class AdditionalUrlsDialog extends AbstractDialog { } get value(): string[] { - return this.textArea.value.split('\n').map(url => url.trim()); + return this.textArea.value.split('\n').map(url => url.trim()).filter(url => !!url); } protected onAfterAttach(message: Message): void {