Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Ivan Sein 2019-02-26 18:34:35 +01:00
Родитель 08cf888e14
Коммит 6988d813f8
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -247,7 +247,10 @@ NSString * const NCRoomCreatedNotification = @"NCRoomCreatedNotification";
NSUInteger newLength = [textField.text length] + [string length] - range.length;
BOOL hasAllowedLength = newLength <= 200;
// 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 YES;

Просмотреть файл

@ -848,7 +848,7 @@ typedef void (^FetchRoomsCompletionBlock)(BOOL success);
BOOL hasAllowedLength = newLength <= 200;
// Enable/Disable rename button
if (hasAllowedLength) {
NSString * newRoomName = [[textField.text stringByReplacingCharactersInRange:range withString:string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSString *newRoomName = [[textField.text stringByReplacingCharactersInRange:range withString:string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
_confirmAction.enabled = (newRoomName.length > 0) && ![_renamimgRoomName isEqualToString:newRoomName];
}
return hasAllowedLength;