mplement proper async initialization for ProfanityFilter
- Add async initialize() method for reliable initialization waiting - Add static create() factory method for easy async creation - Add initialization state tracking with isInitialized flag - Add warning system for methods called before full initialization - Update server.js to use proper async initialization pattern - Maintain backward compatibility with constructor-only usage - Add accessibility improvement for reduced motion preferences in CSS Fixes the race condition issue where consumers relied on arbitrary timeouts instead of properly waiting for async initialization to complete.
This commit is contained in:
parent
542415cccd
commit
4dd48627d0
3 changed files with 150 additions and 40 deletions
|
@ -219,7 +219,13 @@ button[type="submit"]:hover {
|
|||
color: #721c24;
|
||||
border: 2px solid #dc3545;
|
||||
font-weight: bold;
|
||||
animation: pulse 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
/* Only animate for users who haven't requested reduced motion */
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.message.error.profanity-rejection {
|
||||
animation: pulse 0.5s ease-in-out;
|
||||
}
|
||||
}
|
||||
|
||||
[data-theme="dark"] .message.error.profanity-rejection {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue