Fix port being displayed multiple times

This commit is contained in:
GHOSCHT 2022-03-15 09:08:59 +01:00
parent a5afa72620
commit 622afc9afb
No known key found for this signature in database
GPG key ID: A35BD466B8871994

View file

@ -56,9 +56,7 @@ const options: IComboBoxOption[] = [
const fetchPorts = async () => { const fetchPorts = async () => {
const data = await SerialPort.list(); const data = await SerialPort.list();
options.forEach(() => { options.splice(0, options.length);
options.shift();
});
data.forEach((comPort) => { options.push({ key: comPort.path, text: comPort.path }); }); data.forEach((comPort) => { options.push({ key: comPort.path, text: comPort.path }); });
}; };