Skip to content

Commit 11c2913

Browse files
committed
修复Bug
1 parent 7536557 commit 11c2913

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Coding_iOS/Controllers/Topic/CSTopicModel.m

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ + (NSArray*)latestUseTopiclist {
2424

2525
+ (void)addAnotherUseTopic:(NSString*)topicName {
2626
NSMutableArray *list = [[self latestUseTopiclist] mutableCopy];
27-
[list insertObject:topicName atIndex:0];
28-
if(list.count > kMaxUseTopiclistCount) {
29-
[list removeLastObject];
27+
if(![list containsObject:topicName]) {
28+
[list insertObject:topicName atIndex:0];
29+
if(list.count > kMaxUseTopiclistCount) {
30+
[list removeLastObject];
31+
}
32+
[[TMCache TemporaryCache] setObject:list forKey:kLatestUseTopiclist];
3033
}
31-
[[TMCache TemporaryCache] setObject:list forKey:kLatestUseTopiclist];
3234
}
3335

3436
@end

0 commit comments

Comments
 (0)