WidgetManager: createWidget did not call the success block

This commit is contained in:
manuroe
2017-09-11 16:35:42 +02:00
parent a2910d24fa
commit 902d0a5261
+4 -4
View File
@@ -169,6 +169,10 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
return nil;
}
NSString *hash = [NSString stringWithFormat:@"%p", room.mxSession];
successBlockForWidgetCreation[hash][widgetId] = success;
failureBlockForWidgetCreation[hash][widgetId] = failure;
// Send a state event with the widget data
// TODO: This API will be shortly replaced by a pure modular API
return [room sendStateEventOfType:kWidgetEventTypeString
@@ -199,10 +203,6 @@ NSString *const WidgetManagerErrorDomain = @"WidgetManagerErrorDomain";
NSString *modularRestUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"integrationsRestUrl"];
NSString *url = [NSString stringWithFormat:@"%@/widgets/jitsi.html?confId=%@&isAudioConf=%@&displayName=$matrix_display_name&avatarUrl=$matrix_avatar_url&email=$matrix_user_id@", modularRestUrl, confId, video ? @"false" : @"true"];
NSString *hash = [NSString stringWithFormat:@"%p", room.mxSession];
successBlockForWidgetCreation[hash][widgetId] = success;
failureBlockForWidgetCreation[hash][widgetId] = failure;
return [self createWidget:widgetId
withContent:@{
@"url": url,