This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Add character limit validation for flush status

+15 -2
+8 -1
src/app/dashboard/page.tsx
··· 133 133 return; 134 134 } 135 135 136 + // Check character limit - 59 characters maximum (including "is " prefix) 137 + const fullText = `is ${text || 'flushing'}`; 138 + if (fullText.length > 59) { 139 + setError("Your flush status is too long! Please keep it under 59 characters."); 140 + return; 141 + } 142 + 136 143 setIsSubmitting(true); 137 144 setError(null); 138 145 setSuccess(null); ··· 260 267 <button 261 268 type="submit" 262 269 className={styles.submitButton} 263 - disabled={isSubmitting} 270 + disabled={isSubmitting || `is ${text || 'flushing'}`.length > 59} 264 271 > 265 272 {isSubmitting ? 'Updating...' : 'Update Status'} 266 273 </button>
+7 -1
src/app/page.tsx
··· 98 98 return; 99 99 } 100 100 101 + // Check character limit - 59 characters maximum 102 + if (text.length > 59) { 103 + setStatusError("Your flush status is too long! Please keep it under 59 characters."); 104 + return; 105 + } 106 + 101 107 // Check rate limit - 2 posts per 30 minutes (except for the plumber account) 102 108 if (!checkRateLimit()) { 103 109 setStatusError("Trying to make more than 2 flushes in 30 minutes?? Might be time to get the plunger. 🪠 Regular users are limited to 2 flushes per 30 minutes."); ··· 391 397 <button 392 398 type="submit" 393 399 className={styles.submitButton} 394 - disabled={isSubmitting} 400 + disabled={isSubmitting || text.length > 59} 395 401 > 396 402 {isSubmitting ? 'Flushing...' : 'Post Flush'} 397 403 </button>