@@ -67,9 +67,6 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
67
67
]
68
68
)
69
69
70
- /// Whether the user has organizations.
71
- var hasOrganizations : Bool
72
-
73
70
/// The base url used to fetch icons.
74
71
var iconBaseURL : URL ?
75
72
@@ -140,6 +137,10 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
140
137
self
141
138
}
142
139
140
+ var hasOrganizations : Bool {
141
+ cipher. organizationId != nil || ownershipOptions. contains { !$0. isPersonal }
142
+ }
143
+
143
144
/// Whether or not this item can be assigned to collections.
144
145
var canAssignToCollection : Bool {
145
146
guard !collectionIds. isEmpty else { return true }
@@ -271,7 +272,6 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
271
272
configuration: Configuration ,
272
273
customFields: [ CustomFieldState ] ,
273
274
folderId: String ? ,
274
- hasOrganizations: Bool ,
275
275
iconBaseURL: URL ? ,
276
276
identityState: IdentityItemState ,
277
277
isFavoriteOn: Bool ,
@@ -292,7 +292,6 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
292
292
allUserCollections = [ ]
293
293
customFieldsState = AddEditCustomFieldsState ( cipherType: type, customFields: customFields)
294
294
self . folderId = folderId
295
- self . hasOrganizations = hasOrganizations
296
295
self . iconBaseURL = iconBaseURL
297
296
self . identityState = identityState
298
297
self . isFavoriteOn = isFavoriteOn
@@ -317,7 +316,6 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
317
316
collectionIds: [ String ] = [ ] ,
318
317
customFields: [ CustomFieldState ] = [ ] ,
319
318
folderId: String ? = nil ,
320
- hasOrganizations: Bool = false ,
321
319
hasPremium: Bool ,
322
320
name: String ? = nil ,
323
321
organizationId: String ? = nil ,
@@ -333,7 +331,6 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
333
331
configuration: . add,
334
332
customFields: customFields,
335
333
folderId: folderId,
336
- hasOrganizations: hasOrganizations,
337
334
iconBaseURL: nil ,
338
335
identityState: . init( ) ,
339
336
isFavoriteOn: false ,
@@ -364,7 +361,6 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
364
361
configuration: . add,
365
362
customFields: cipherView. customFields,
366
363
folderId: cipherView. folderId,
367
- hasOrganizations: cipherView. organizationId != nil ,
368
364
iconBaseURL: nil ,
369
365
identityState: cipherView. identityItemState ( ) ,
370
366
isFavoriteOn: cipherView. favorite,
@@ -396,7 +392,6 @@ struct CipherItemState: Equatable { // swiftlint:disable:this type_body_length
396
392
configuration: . existing( cipherView: cipherView) ,
397
393
customFields: cipherView. customFields,
398
394
folderId: cipherView. folderId,
399
- hasOrganizations: cipherView. organizationId != nil ,
400
395
iconBaseURL: iconBaseURL,
401
396
identityState: cipherView. identityItemState ( ) ,
402
397
isFavoriteOn: cipherView. favorite,
0 commit comments