From 00fcb3af432209d7e2af4b4fa67a9b78790208c8 Mon Sep 17 00:00:00 2001 From: Philip Langer Date: Fri, 1 Mar 2024 20:40:32 +0100 Subject: [PATCH] Guard state update --- src/webview/memory-webview-view.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/webview/memory-webview-view.tsx b/src/webview/memory-webview-view.tsx index e4ebe70..6ef5a45 100644 --- a/src/webview/memory-webview-view.tsx +++ b/src/webview/memory-webview-view.tsx @@ -98,7 +98,10 @@ class App extends React.Component<{}, MemoryAppState> { (this.state.addressPadding === 'Min' && this.state.memory !== prevState.memory) || this.state.addressPadding !== prevState.addressPadding; if (addressPaddingNeedsUpdate) { - this.setState({ effectiveAddressLength: this.getEffectiveAddressLength(this.state.memory), }); + const effectiveAddressLength = this.getEffectiveAddressLength(this.state.memory); + if (this.state.effectiveAddressLength !== effectiveAddressLength) { + this.setState({ effectiveAddressLength }); + } } }