From b9518fbf3641f44e3dde7a6366fa36abc415e59a Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Fri, 16 Jul 2021 13:05:28 -0600 Subject: [PATCH] cleaner --- .../marketplace-list/marketplace-list.page.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts index 5896d1e62..5b44b4eba 100644 --- a/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts +++ b/ui/src/app/pages/marketplace-routes/marketplace-list/marketplace-list.page.ts @@ -54,12 +54,12 @@ export class MarketplaceListPage { ]) this.eos = eos this.data = data - this.data.categories.unshift('updates') - if (data.categories.includes(this.category)) { - data.categories = data.categories.filter(cat => this.category !== cat) - } - data.categories.unshift(this.category) - data.categories.push('all') + + // category should start as first item in array + // remove here then add at beginning + const filterdCategories = this.data.categories.filter(cat => this.category !== cat) + this.data.categories = [this.category, 'updates'].concat(filterdCategories).concat(['all']) + } catch (e) { console.error(e) this.errToast.present(e.message)