mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 18:42:24 +00:00
Removed caching for trash and templates as it does not get correctly updated when the respective groups get deleted
This commit is contained in:
@@ -158,6 +158,9 @@
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="emptyTrash:" target="-1" id="uIZ-CN-kXB"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
|
||||
@@ -313,13 +313,9 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
||||
}
|
||||
|
||||
- (KPKGroup *)trash {
|
||||
static KPKGroup *_trash = nil;
|
||||
/* Caching is dangerous, as we might have deleted the trashcan */
|
||||
if(self.useTrash) {
|
||||
BOOL trashValid = [_trash.uuid isEqual:self.tree.metaData.recycleBinUuid];
|
||||
if(!trashValid) {
|
||||
_trash = [self findGroup:self.tree.metaData.recycleBinUuid];
|
||||
}
|
||||
return _trash;
|
||||
return [self findGroup:self.tree.metaData.recycleBinUuid];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
@@ -329,12 +325,8 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
||||
}
|
||||
|
||||
- (KPKGroup *)templates {
|
||||
static KPKGroup *_templates = nil;
|
||||
BOOL templateValid = [_templates.uuid isEqual:self.tree.metaData.entryTemplatesGroup];
|
||||
if(!templateValid) {
|
||||
_templates = [self findGroup:self.tree.metaData.entryTemplatesGroup];
|
||||
}
|
||||
return _templates;
|
||||
/* Caching is dangerous as we might have deleted the group */
|
||||
return [self findGroup:self.tree.metaData.entryTemplatesGroup];
|
||||
}
|
||||
|
||||
- (void)setTrash:(KPKGroup *)trash {
|
||||
|
||||
Reference in New Issue
Block a user