diff --git a/.dumi/theme/builtins/AppDetail.tsx b/.dumi/theme/builtins/AppDetail.tsx index d1b0ece..b0d43d2 100644 --- a/.dumi/theme/builtins/AppDetail.tsx +++ b/.dumi/theme/builtins/AppDetail.tsx @@ -57,6 +57,7 @@ const AppDetail = ({}) => { const [caskDetail, setCaskDetail] = useState({}); const [formulaDetail, setFormulaDetail] = useState({}); const [isCask, setIsCask] = useState(true); + const [isLoading, setIsLoading] = useState(true); useEffect(() => { const query = getQuery(); @@ -72,7 +73,8 @@ const AppDetail = ({}) => { const getCaskDetail = id => { fetch( - AVALON_SERVER + '/homebrew/cask-detail?' + + AVALON_SERVER + + '/homebrew/cask-detail?' + queryString.stringify({ id, }), @@ -86,13 +88,15 @@ const AppDetail = ({}) => { result.depends_on = JSON.parse(result.depends_on); setCaskDetail(result); + setIsLoading(false); } }); }; const getFormulaDetail = id => { fetch( - AVALON_SERVER + '/homebrew/formula-detail?' + + AVALON_SERVER + + '/homebrew/formula-detail?' + queryString.stringify({ id, }), @@ -107,8 +111,9 @@ const AppDetail = ({}) => { // result.dependencies = JSON.parse(result.dependencies); // result.build_dependencies = JSON.parse(result.build_dependencies); - console.log(result); setFormulaDetail(result); + + setIsLoading(false); } }); }; @@ -219,6 +224,12 @@ const AppDetail = ({}) => {