This commit is contained in:
seb
2026-10-12 18:41:53 +02:00
parent 2cfa263044
commit 6b0839639d
6 changed files with 13 additions and 1 deletions

View File

@@ -54,6 +54,7 @@ import {
* @property {string|null} languageId
* @property {Record<string,object>|null} categories id → node map
* @property {number|string|null} rootCategoryId
* @property {number} articleCount Total parent articles in tree
* @property {boolean} renameMode
* @property {'idle'|'loading'|'succeeded'|'failed'} treeStatus
* @property {string|null} error
@@ -66,6 +67,7 @@ const initialState = {
languageId: null,
categories: null,
rootCategoryId: null,
articleCount: 0,
renameMode: false,
treeStatus: 'idle',
error: null,
@@ -87,6 +89,8 @@ export function getCategoryState() {
return { categories: state.categories, rootCategoryId: state.rootCategoryId };
}
export const selectCategoryTreeArticleCount = () => categoryAutomat.state.articleCount;
/**
* Resolves once the category tree has loaded.
*
@@ -123,6 +127,7 @@ const actions = {
languageId: parsed.languageId,
categories: parsed.categories,
rootCategoryId: parsed.rootCategoryId,
articleCount: parsed.articleCount,
error: null,
viewsLoading: true,
});

View File

@@ -106,8 +106,10 @@ export const selectCompanyId = () => companyAutomat.state.current?.id ?? null;
export const selectCompanyStatus = () => companyAutomat.state.status;
export const selectCompanyName = () => companyAutomat.state.current?.name;
export const selectCompanyIso639 = () => companyAutomat.state.current?.iso639;
export const selectCompanyLanguageId = () => companyAutomat.state.current?.languageId ?? null;
export const selectCompanyTaxrate = () => companyAutomat.state.current?.taxrate ?? null;
export const selectCompanyReducedTaxrate = () => companyAutomat.state.current?.reducedtaxrate ?? null;
export const selectCompanyTaxfreerate = () => companyAutomat.state.current?.taxfreerate ?? null;
export const selectCompanyRootCategoryId = () => companyAutomat.state.current?.rootCategoryId ?? null;
export default companyAutomat;

View File

@@ -104,8 +104,10 @@ export {
selectCompanyStatus,
selectCompanyName,
selectCompanyIso639,
selectCompanyLanguageId,
selectCompanyTaxrate,
selectCompanyReducedTaxrate,
selectCompanyTaxfreerate,
selectCompanyRootCategoryId,
} from './companyAutomat';
@@ -133,6 +135,7 @@ export {
normalizeCategoryMap,
getCategoryState,
whenCategoryTreeReady,
selectCategoryTreeArticleCount,
} from './categoryAutomat';
/**