From 205d7a3e1b72afbd487ec9f0b6368442fa678d42 Mon Sep 17 00:00:00 2001 From: Ramzan Date: Fri, 17 Jul 2020 19:31:21 -0400 Subject: [PATCH] Prevent autoRefresh from running when editing an item --- src/App.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 41e0f3e..fa4793d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -282,7 +282,11 @@ class App extends React.PureComponent { } private autoRefresh() { - if (navigator.onLine && this.props.credentials) { this.refresh() } + if (navigator.onLine && this.props.credentials && + !(window.location.pathname.match(/.*\/(new|edit|copy)$/))) { + this.refresh(); + } + } componentDidMount() {