зеркало из https://github.com/nextcloud/talk-ios.git
Fix room creation check.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
08cf888e14
Коммит
6988d813f8
|
@ -247,7 +247,10 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
|
||||||
NSUInteger newLength = [textField.text length] + [string length] - range.length;
|
NSUInteger newLength = [textField.text length] + [string length] - range.length;
|
||||||
BOOL hasAllowedLength = newLength <= 200;
|
BOOL hasAllowedLength = newLength <= 200;
|
||||||
// Enable/Disable create button
|
// Enable/Disable create button
|
||||||
_createRoomButton.enabled = newLength > 0 && hasAllowedLength;
|
if (hasAllowedLength) {
|
||||||
|
NSString *roomName = [[textField.text stringByReplacingCharactersInRange:range withString:string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||||
|
_createRoomButton.enabled = roomName.length > 0;
|
||||||
|
}
|
||||||
return hasAllowedLength;
|
return hasAllowedLength;
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче