fix: Create a subdirectory in the tmp directory

This commit is contained in:
Inex Code 2025-08-31 17:13:48 +03:00
parent 07a2c9a256
commit 6540a6303f
No known key found for this signature in database

View file

@ -65,7 +65,12 @@ Future<MatrixSdkDatabase> _constructDatabase(String clientName) async {
Directory? fileStorageLocation;
try {
fileStorageLocation = await getTemporaryDirectory();
final tmpDir = await getTemporaryDirectory();
final appTmpDir = Directory(join(tmpDir.path, clientName));
if (!await appTmpDir.exists()) {
await appTmpDir.create(recursive: true);
}
fileStorageLocation = appTmpDir;
} on MissingPlatformDirectoryException catch (_) {
Logs().w(
'No temporary directory for file cache available on this platform.',