slack status without the slack status.zzstoatzz.io/
quickslice

fix: Allow emoji-only status changes without text

When creating a new status with only an emoji change (no text), the
validation was incorrectly showing 'No changes'. Fixed by:

1. Properly handling the case where there's no current status (emoji is null)
2. Triggering validation after emoji selection from picker
3. Only disabling submission when the new status is identical to existing

Fixes #56

Co-authored-by: nate nowack <zzstoatzz@users.noreply.github.com>

+11 -1
+11 -1
templates/status.html
··· 2045 2046 statusInput.value = emoji; 2047 emojiPicker.style.display = 'none'; 2048 }); 2049 }); 2050 } else if (category === 'custom') { ··· 2071 selectedEmoji.innerHTML = `<img src="${img.src}" alt="${img.alt}" style="width: 100%; height: 100%; object-fit: contain;">`; 2072 statusInput.value = emojiValue; 2073 emojiPicker.style.display = 'none'; 2074 }); 2075 }); 2076 } else { ··· 2088 selectedEmoji.textContent = emoji; 2089 statusInput.value = emoji; 2090 emojiPicker.style.display = 'none'; 2091 }); 2092 }); 2093 } ··· 2323 2324 statusInput.value = emojiValue; 2325 emojiPicker.style.display = 'none'; 2326 // Clear search when emoji is selected 2327 document.getElementById('emoji-search').value = ''; 2328 }); ··· 2360 const newText = statusText.value.trim(); 2361 2362 // Check if this is identical to current status 2363 - if (currentStatus.emoji === newEmoji && currentStatus.text === newText) { 2364 saveBtn.disabled = true; 2365 saveBtn.textContent = 'No changes'; 2366 } else {
··· 2045 2046 statusInput.value = emoji; 2047 emojiPicker.style.display = 'none'; 2048 + checkForChanges(); 2049 }); 2050 }); 2051 } else if (category === 'custom') { ··· 2072 selectedEmoji.innerHTML = `<img src="${img.src}" alt="${img.alt}" style="width: 100%; height: 100%; object-fit: contain;">`; 2073 statusInput.value = emojiValue; 2074 emojiPicker.style.display = 'none'; 2075 + checkForChanges(); 2076 }); 2077 }); 2078 } else { ··· 2090 selectedEmoji.textContent = emoji; 2091 statusInput.value = emoji; 2092 emojiPicker.style.display = 'none'; 2093 + checkForChanges(); 2094 }); 2095 }); 2096 } ··· 2326 2327 statusInput.value = emojiValue; 2328 emojiPicker.style.display = 'none'; 2329 + checkForChanges(); 2330 // Clear search when emoji is selected 2331 document.getElementById('emoji-search').value = ''; 2332 }); ··· 2364 const newText = statusText.value.trim(); 2365 2366 // Check if this is identical to current status 2367 + // If there's no current status (emoji is null), allow any emoji selection as a change 2368 + const hasCurrentStatus = currentStatus.emoji !== null; 2369 + const isIdentical = hasCurrentStatus && 2370 + currentStatus.emoji === newEmoji && 2371 + currentStatus.text === newText; 2372 + 2373 + if (isIdentical) { 2374 saveBtn.disabled = true; 2375 saveBtn.textContent = 'No changes'; 2376 } else {