fix(frontend): render-loop in Tasks/Reports/Communication behoben — usePluginToolbarStore wurde ohne Selector destrukturiert; jedes Store-Update re-renderte alle Seiten inkl. registerItems-Effektkette (Maximum update depth in Tests sichtbar). Selektor-Pattern wie Dms/Mail/Calendar/ContactsList
This commit is contained in:
@@ -755,7 +755,8 @@ export function CommunicationPage() {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [showNewChat, setShowNewChat] = useState<ConversationCategory | null>(null);
|
||||
const [mobileView, setMobileView] = useState<'list' | 'chat'>('list');
|
||||
const { registerItems, unregisterPlugin } = usePluginToolbarStore();
|
||||
const registerItems = usePluginToolbarStore((s) => s.registerItems);
|
||||
const unregisterPlugin = usePluginToolbarStore((s) => s.unregisterPlugin);
|
||||
|
||||
const loadConversations = useCallback(async () => {
|
||||
try {
|
||||
|
||||
@@ -60,7 +60,8 @@ interface DownloadEntry {
|
||||
export function ReportsPage() {
|
||||
const { t } = useTranslation();
|
||||
const toast = useToast();
|
||||
const { registerItems, unregisterPlugin } = usePluginToolbarStore();
|
||||
const registerItems = usePluginToolbarStore((s) => s.registerItems);
|
||||
const unregisterPlugin = usePluginToolbarStore((s) => s.unregisterPlugin);
|
||||
|
||||
// Data hooks
|
||||
const { data: templates = [], isLoading: templatesLoading } = useReportTemplates();
|
||||
|
||||
@@ -220,7 +220,8 @@ function TaskDetail({ task, onEdit, onDelete, onStatusChange }: TaskDetailProps)
|
||||
export function TasksPage() {
|
||||
const { t } = useTranslation();
|
||||
const toast = useToast();
|
||||
const { registerItems, unregisterPlugin } = usePluginToolbarStore();
|
||||
const registerItems = usePluginToolbarStore((s) => s.registerItems);
|
||||
const unregisterPlugin = usePluginToolbarStore((s) => s.unregisterPlugin);
|
||||
|
||||
const [page, setPage] = useState(1);
|
||||
const [filter, setFilter] = useState<TaskFilter>({});
|
||||
|
||||
Reference in New Issue
Block a user