1
Fork 0
mirror of https://github.com/Steffo99/todocolors.git synced 2024-11-25 17:54:18 +00:00

Don't send title change request if no changes have been applied

This commit is contained in:
Steffo 2023-08-16 15:48:50 +02:00
parent 6e985405d8
commit ac7946ddc2
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -17,10 +17,12 @@ export function useBoardMetadataEditor() {
const stopEditingMetadata = useCallback(() => {
console.debug("[useEditableTitle] Ending title edit...");
setEditingMetadata(false);
if(titleFromState !== titleFromEditor) {
console.debug("[useEditableTitle] Sending title change request...");
const request: TitleBoardRequest = {"Title": titleFromEditor}
sendRequest(request)
}, [sendRequest, titleFromEditor])
}
}, [sendRequest, titleFromState, titleFromEditor])
const toggleEditingMetadata = useCallback(() => {
return isEditingMetadata ? stopEditingMetadata() : startEditingMetadata()