-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1672 from ardriveapp/PE-5845-improve-sync-and-dri…
…ve-explorer-navigation-performance-by-removing-the-usage-of-paths-on-folders-and-files PE-5845: improve sync and drive explorer navigation performance by removing the usage of paths on folders and files
- Loading branch information
Showing
54 changed files
with
941 additions
and
697 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:ardrive/core/arfs/repository/folder_repository.dart'; | ||
import 'package:ardrive/pages/drive_detail/drive_detail_page.dart'; | ||
import 'package:ardrive/utils/logger.dart'; | ||
|
||
class BreadcrumbBuilder { | ||
final FolderRepository _folderRepository; | ||
|
||
BreadcrumbBuilder(this._folderRepository); | ||
|
||
Future<List<BreadCrumbRowInfo>> buildForFolder({ | ||
required String folderId, | ||
required String rootFolderId, | ||
required String driveId, | ||
}) async { | ||
List<BreadCrumbRowInfo> breadcrumbs = []; | ||
String? currentFolderId = folderId; | ||
|
||
while (currentFolderId != null && currentFolderId != rootFolderId) { | ||
final folderRevision = await _folderRepository | ||
.getLatestFolderRevisionInfo(driveId, currentFolderId); | ||
if (folderRevision == null) { | ||
logger.e('FolderRevision not found for folderId: $currentFolderId'); | ||
throw Exception( | ||
'FolderRevision not found for folderId: $currentFolderId'); | ||
} | ||
|
||
breadcrumbs.insert( | ||
0, | ||
BreadCrumbRowInfo( | ||
text: folderRevision.name, | ||
targetId: folderRevision.folderId, | ||
), | ||
); | ||
currentFolderId = folderRevision.parentFolderId; | ||
} | ||
|
||
return breadcrumbs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.