Skip to content

Commit

Permalink
ローディング状態の修正***
Browse files Browse the repository at this point in the history
***ローディング状態の修正を追加しました
  • Loading branch information
Jun-Murakami committed May 6, 2024
1 parent 6d74e83 commit aa29176
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions src/hooks/useObserve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const useObserve = () => {
await loadSettingsFromIdb();
await loadTreesListFromIdb();
await loadQuickMemoFromIdb();
setIsLoading(false);
// ローカルストレージからitems_offlineとtreeName_offline、quick_memo_offlineを読み込む
const { value: itemsOffline } = await Preferences.get({ key: `items_offline` });
const { value: treeNameOffline } = await Preferences.get({ key: `treeName_offline` });
Expand Down
3 changes: 0 additions & 3 deletions src/hooks/useTreeManagement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export const useTreeManagement = () => {
return;
}
try {
if (!isLoading) setIsLoading(true);
const treeData = await loadCurrentTreeDataFromIdb(targetTree);
if (treeData && treeData.name && treeData.membersV2 && treeData.items) {
setCurrentTreeName(treeData.name);
Expand All @@ -91,9 +90,7 @@ export const useTreeManagement = () => {
setItems(treeData.items);
}

setIsLoading(false);
} catch (error) {
setIsLoading(false);
await showDialog('ツリーのデータの取得に失敗しました。\n\n' + error, 'Error');
}
};
Expand Down

0 comments on commit aa29176

Please sign in to comment.