u
This commit is contained in:
@@ -30,6 +30,7 @@ import { Automat } from 'react-automat';
|
||||
import { category as categoryApi, article as articleApi } from '../api';
|
||||
import authAutomat from './authAutomat';
|
||||
import companyAutomat from './companyAutomat';
|
||||
import sseAutomat from './sseAutomat';
|
||||
import {
|
||||
attachCategoryTree,
|
||||
categoryViews,
|
||||
@@ -37,6 +38,7 @@ import {
|
||||
disposeAllCategoryViewAutomats,
|
||||
refreshCategoryViewChildren,
|
||||
appendArticlesToCategoryViews,
|
||||
updateArticleInCategoryViews,
|
||||
removeArticleBySku,
|
||||
waitForCategoryTree,
|
||||
} from './categoryViewAutomat';
|
||||
@@ -512,6 +514,14 @@ authAutomat.subscribe((auth) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Upstream Trigger: sseAutomat
|
||||
if (sseAutomat?.actions?.on) {
|
||||
sseAutomat.actions.on('category', () => {
|
||||
void categoryAutomat.actions.loadTree().catch(() => {});
|
||||
invalidateAllCategoryViews();
|
||||
});
|
||||
}
|
||||
|
||||
// Re-export pure helpers for consumers that previously imported from categorySlice
|
||||
export {
|
||||
ROOT_CATEGORY_NAME,
|
||||
@@ -532,6 +542,7 @@ export {
|
||||
disposeAllCategoryViewAutomats,
|
||||
loadAllCategoryViews,
|
||||
collectLoadedCategoryViewData,
|
||||
updateArticleInCategoryViews,
|
||||
} from './categoryViewAutomat';
|
||||
|
||||
export default categoryAutomat;
|
||||
|
||||
Reference in New Issue
Block a user