mirror of
https://github.com/Steffo99/todocolors.git
synced 2024-11-22 16:24:19 +00:00
Don't send title change request if no changes have been applied
This commit is contained in:
parent
6e985405d8
commit
ac7946ddc2
1 changed files with 6 additions and 4 deletions
|
@ -17,10 +17,12 @@ export function useBoardMetadataEditor() {
|
||||||
const stopEditingMetadata = useCallback(() => {
|
const stopEditingMetadata = useCallback(() => {
|
||||||
console.debug("[useEditableTitle] Ending title edit...");
|
console.debug("[useEditableTitle] Ending title edit...");
|
||||||
setEditingMetadata(false);
|
setEditingMetadata(false);
|
||||||
console.debug("[useEditableTitle] Sending title change request...");
|
if(titleFromState !== titleFromEditor) {
|
||||||
const request: TitleBoardRequest = {"Title": titleFromEditor}
|
console.debug("[useEditableTitle] Sending title change request...");
|
||||||
sendRequest(request)
|
const request: TitleBoardRequest = {"Title": titleFromEditor}
|
||||||
}, [sendRequest, titleFromEditor])
|
sendRequest(request)
|
||||||
|
}
|
||||||
|
}, [sendRequest, titleFromState, titleFromEditor])
|
||||||
|
|
||||||
const toggleEditingMetadata = useCallback(() => {
|
const toggleEditingMetadata = useCallback(() => {
|
||||||
return isEditingMetadata ? stopEditingMetadata() : startEditingMetadata()
|
return isEditingMetadata ? stopEditingMetadata() : startEditingMetadata()
|
||||||
|
|
Loading…
Reference in a new issue