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>

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