From 96687973bd75d8f8ccc3e3ebd0def766e50fed6b Mon Sep 17 00:00:00 2001 From: DomWane Date: Wed, 2 Oct 2024 15:08:47 +0200 Subject: [PATCH] fix: features filter --- composables/useData.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/composables/useData.ts b/composables/useData.ts index 6b95e16..dcf0f2c 100644 --- a/composables/useData.ts +++ b/composables/useData.ts @@ -159,9 +159,23 @@ export const useData = defineStore('data', () => { } if (selectedFeature) { - const features = project.technology?.features?.map(f => f.toLowerCase()) || [] - if (!features.includes(selectedFeature)) - return false + switch (selectedFeature) { + case 'no-compliance': + return project.compliance ? false : true + case 'non-kyc': + return project.tracebility?.kyc ? false : true + case 'private-by-default': + return project.default_privacy + case 'non-custodial': + return project.blockchain_features?.asset_custody_type === 'non-custody' + case 'opensource': + return project.blockchain_features?.opensource + case 'live-on-mainnet': + return project.project_phase === 'mainnet' + } + // const features = project.technology?.features?.map(f => f.toLowerCase()) || [] + // if (!features.includes(selectedFeature)) + // return false } return true