Update AgentDashboard.tsx
This commit is contained in:
@@ -274,9 +274,13 @@ export const AgentDashboard: React.FC<AgentDashboardProps> = ({
|
|||||||
const [newQueueForm, setNewQueueForm] = useState<Partial<TicketQueue>>({ name: '', description: '' });
|
const [newQueueForm, setNewQueueForm] = useState<Partial<TicketQueue>>({ name: '', description: '' });
|
||||||
const [tempSettings, setTempSettings] = useState<AppSettings>(settings);
|
const [tempSettings, setTempSettings] = useState<AppSettings>(settings);
|
||||||
|
|
||||||
|
// Sync tempSettings with settings prop ONLY if NOT in settings view
|
||||||
|
// This prevents background polling from resetting form data while the user is typing
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (view !== 'settings') {
|
||||||
setTempSettings(settings);
|
setTempSettings(settings);
|
||||||
}, [settings]);
|
}
|
||||||
|
}, [settings, view]);
|
||||||
|
|
||||||
const [isTestingSmtp, setIsTestingSmtp] = useState(false);
|
const [isTestingSmtp, setIsTestingSmtp] = useState(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user