diff --git a/packages/noodl-editor/src/editor/src/views/panels/CloudServicePanel/CloudServiceModal/CloudSerivceModal.tsx b/packages/noodl-editor/src/editor/src/views/panels/CloudServicePanel/CloudServiceModal/CloudSerivceModal.tsx index 285958e..fe23794 100644 --- a/packages/noodl-editor/src/editor/src/views/panels/CloudServicePanel/CloudServiceModal/CloudSerivceModal.tsx +++ b/packages/noodl-editor/src/editor/src/views/panels/CloudServicePanel/CloudServiceModal/CloudSerivceModal.tsx @@ -42,10 +42,23 @@ function AsSelfHosted({ }: CloudServiceModalProps) { const [name, setName] = useState(environment.name); const [description, setDescription] = useState(environment.description); + const [appId, setAppId] = useState(environment.appId); + const [url, setUrl] = useState(environment.url); const [showMasterKey, setShowMasterKey] = useState(false); const [masterKey, setMasterKey] = useState(environment.masterKey); function update() { + // Early return if none of the values changed + if ( + name === environment.name && + description === environment.description && + appId === environment.appId && + masterKey === environment.masterKey && + url === environment.url + ) { + return; + } + CloudService.instance.backend .update({ id: environment.id, @@ -86,12 +99,14 @@ function AsSelfHosted({ setAppId(e.target.value)} + onBlur={update} + onEnter={update} /> setUrl(e.target.value)} + onBlur={update} + onEnter={update} />