u
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user