mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 08:10:28 +09:00
파일 시스템 관련 상태와 변경 로직을 도메인 모듈로 통합하여 캐시가 자동으로 갱신되도록 개선하고 오류를 토스트로 표시하도록 변경
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ce73aa331
commit
4e82c5e556
67 files changed
+1091
-1082
No files matched your search
@@ -1,12 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { BottomDiv, BottomSheet, Button, FullscreenDiv } from "#lib/components/atoms/index.js";
|
||||
import { SubCategories } from "#lib/components/molecules/index.js";
|
||||
import {
|
||||
getCategoryInfo,
|
||||
type LocalCategoryInfo,
|
||||
type MaybeCategoryInfo,
|
||||
} from "#lib/modules/filesystem/index.js";
|
||||
import { HybridPromise } from "#lib/utils/index.js";
|
||||
import { useCategory, type LocalCategoryInfo } from "#lib/features/filesystem/index.js";
|
||||
|
||||
interface Props {
|
||||
isOpen: boolean;
|
||||
@@ -16,11 +11,13 @@
|
||||
|
||||
let { isOpen = $bindable(), mode, onSelectCategoryClick }: Props = $props();
|
||||
|
||||
let categoryInfo: MaybeCategoryInfo | undefined = $state();
|
||||
let categoryId: CategoryId = $state("root");
|
||||
const category = useCategory(() => categoryId);
|
||||
let categoryInfo = $derived(category.current);
|
||||
|
||||
$effect(() => {
|
||||
$effect.pre(() => {
|
||||
if (isOpen) {
|
||||
HybridPromise.resolve(getCategoryInfo("root")).then((result) => (categoryInfo = result));
|
||||
categoryId = "root";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -31,8 +28,7 @@
|
||||
<SubCategories
|
||||
class="py-4"
|
||||
info={categoryInfo}
|
||||
onSubCategoryClick={({ id }) =>
|
||||
HybridPromise.resolve(getCategoryInfo(id)).then((result) => (categoryInfo = result))}
|
||||
onSubCategoryClick={({ id }) => (categoryId = id)}
|
||||
/>
|
||||
{#if categoryInfo.id !== "root"}
|
||||
<BottomDiv>
|
||||
|
||||
Reference in new issue
Block a user