From 2bc2fb14f6e38ec470faeefcfbd9815ae6b9e1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Mon, 4 Dec 2023 02:05:04 +0100 Subject: [PATCH] Only update selected if different from current --- src/js/app.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/js/app.tsx b/src/js/app.tsx index 926bfcc..7dfe717 100644 --- a/src/js/app.tsx +++ b/src/js/app.tsx @@ -64,9 +64,11 @@ export class App extends React.Component { } updateSelect(selected: string): void { - this.setState((state) => { - return { streamList: state.streamList, selectedStream: selected } - }) + if (selected !== this.state.selectedStream) { + this.setState((state) => { + return { streamList: state.streamList, selectedStream: selected } + }) + } } render() {