TF-2311 Only delete the folder when it exists

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit d3cf489cbc71bfa0c05d0c633136d504d3d9dfdd)
This commit is contained in:
dab246
2023-11-14 17:20:43 +07:00
committed by Dat Vu
parent eb3e27ce91
commit 5871225537
2 changed files with 9 additions and 5 deletions
+5 -3
View File
@@ -128,10 +128,12 @@ class CachingManager {
return await HiveCacheConfig().closeHive();
}
void clearAllFileInStorage() {
Future<void> clearAllFileInStorage() async {
if (PlatformInfo.isMobile) {
_fileUtils.removeFolder(CachingConstants.newEmailsContentFolderName);
_fileUtils.removeFolder(CachingConstants.openedEmailContentFolderName);
await Future.wait([
_fileUtils.removeFolder(CachingConstants.newEmailsContentFolderName),
_fileUtils.removeFolder(CachingConstants.openedEmailContentFolderName),
]);
}
}