mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
Fix a race condition observed when the app renders an image in a Group/Community description
This commit is contained in:
@@ -516,8 +516,6 @@
|
||||
// Check whether the provided URL is a valid Matrix Content URI.
|
||||
if (cacheFilePath)
|
||||
{
|
||||
localSourcePath = [NSString stringWithFormat:@"file://%@", cacheFilePath];
|
||||
|
||||
// Download the thumbnail if it is not already stored in the cache.
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:cacheFilePath])
|
||||
{
|
||||
@@ -529,10 +527,15 @@
|
||||
withMethod:MXThumbnailingMethodScale
|
||||
success:^(NSString *outputFilePath) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
[self renderGroupLongDescription];
|
||||
[self refreshGroupLongDescription];
|
||||
}
|
||||
failure:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update the local path
|
||||
localSourcePath = [NSString stringWithFormat:@"file://%@", cacheFilePath];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -545,8 +548,6 @@
|
||||
// Check whether the provided URL is a valid Matrix Content URI.
|
||||
if (cacheFilePath)
|
||||
{
|
||||
localSourcePath = [NSString stringWithFormat:@"file://%@", cacheFilePath];
|
||||
|
||||
// Download the image if it is not already stored in the cache.
|
||||
if (![[NSFileManager defaultManager] fileExistsAtPath:cacheFilePath])
|
||||
{
|
||||
@@ -556,10 +557,15 @@
|
||||
inFolder:kMXMediaManagerDefaultCacheFolder
|
||||
success:^(NSString *outputFilePath) {
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
[self renderGroupLongDescription];
|
||||
[self refreshGroupLongDescription];
|
||||
}
|
||||
failure:nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update the local path
|
||||
localSourcePath = [NSString stringWithFormat:@"file://%@", cacheFilePath];
|
||||
}
|
||||
}
|
||||
}
|
||||
return localSourcePath;
|
||||
|
||||
Reference in New Issue
Block a user