We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7536557 commit 11c2913Copy full SHA for 11c2913
1 file changed
Coding_iOS/Controllers/Topic/CSTopicModel.m
@@ -24,11 +24,13 @@ + (NSArray*)latestUseTopiclist {
24
25
+ (void)addAnotherUseTopic:(NSString*)topicName {
26
NSMutableArray *list = [[self latestUseTopiclist] mutableCopy];
27
- [list insertObject:topicName atIndex:0];
28
- if(list.count > kMaxUseTopiclistCount) {
29
- [list removeLastObject];
+ if(![list containsObject:topicName]) {
+ [list insertObject:topicName atIndex:0];
+ if(list.count > kMaxUseTopiclistCount) {
30
+ [list removeLastObject];
31
+ }
32
+ [[TMCache TemporaryCache] setObject:list forKey:kLatestUseTopiclist];
33
}
- [[TMCache TemporaryCache] setObject:list forKey:kLatestUseTopiclist];
34
35
36
@end
0 commit comments