mirror of
https://github.com/samsonjs/samhuri.net-ios.git
synced 2026-04-22 14:06:00 +00:00
remove pointless warning now that editor is disabled during save
This commit is contained in:
parent
2f92db3d73
commit
41f939ef97
3 changed files with 10 additions and 8 deletions
|
|
@ -74,9 +74,6 @@
|
|||
#pragma mark - Managing the detail item
|
||||
|
||||
- (void)configureWithPost:(Post *)post {
|
||||
if (self.modifiedPost && ![self.modifiedPost isEqualToPost:self.post]) {
|
||||
NSLog(@"WARNING: clobbering unsaved changes to %@", self.modifiedPost);
|
||||
}
|
||||
if (![post isEqual:self.post]) {
|
||||
self.post = post;
|
||||
self.modifiedPost = post;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
- (instancetype)copyWithBody:(NSString *)body;
|
||||
- (instancetype)copyWithTitle:(NSString *)title;
|
||||
- (instancetype)copyWithURL:(NSURL *)url;
|
||||
- (instancetype)copyWithNew:(BOOL)isNew;
|
||||
- (BOOL)isEqualToPost:(Post *)other;
|
||||
|
||||
@end
|
||||
|
|
|
|||
14
Blog/Post.m
14
Blog/Post.m
|
|
@ -63,18 +63,22 @@
|
|||
}
|
||||
|
||||
- (instancetype)copyWithBody:(NSString *)body {
|
||||
return [self copyWithTitle:self.title body:body url:self.url];
|
||||
return [self copyWithTitle:self.title body:body url:self.url new:self.new];
|
||||
}
|
||||
|
||||
- (instancetype)copyWithTitle:(NSString *)title {
|
||||
return [self copyWithTitle:title body:self.body url:self.url];
|
||||
return [self copyWithTitle:title body:self.body url:self.url new:self.new];
|
||||
}
|
||||
|
||||
- (instancetype)copyWithURL:(NSURL *)url {
|
||||
return [self copyWithTitle:self.title body:self.body url:url];
|
||||
return [self copyWithTitle:self.title body:self.body url:url new:self.new];
|
||||
}
|
||||
|
||||
- (instancetype)copyWithTitle:(NSString *)title body:(NSString *)body url:(NSURL *)url {
|
||||
- (instancetype)copyWithNew:(BOOL)isNew {
|
||||
return [self copyWithTitle:self.title body:self.body url:self.url new:isNew];
|
||||
}
|
||||
|
||||
- (instancetype)copyWithTitle:(NSString *)title body:(NSString *)body url:(NSURL *)url new:(BOOL)isNew {
|
||||
return [[Post alloc] initWithDictionary:@{
|
||||
@"objectID" : self.objectID ?: [NSNull null],
|
||||
@"slug" : self.slug ?: [NSNull null],
|
||||
|
|
@ -85,7 +89,7 @@
|
|||
@"path" : self.path ?: [NSNull null],
|
||||
@"url" : url ?: [NSNull null],
|
||||
@"draft" : @(self.draft),
|
||||
@"new" : @(self.new),
|
||||
@"new" : @(isNew),
|
||||
} error:nil];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue