Skip to content

Commit

Permalink
include kit and kit-duotone on family drop down only when present in …
Browse files Browse the repository at this point in the history
…the kit
  • Loading branch information
mlwilkerson committed May 22, 2024
1 parent 3b9b2d1 commit 97baf4f
Showing 1 changed file with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Prop,
State
} from "@stencil/core";
import { debounce, get, set, size } from "lodash";
import { debounce, find, get, set, size } from "lodash";
import {
buildIconChooserResult,
CONSOLE_MESSAGE_PREFIX,
Expand Down Expand Up @@ -306,10 +306,25 @@ export class FaIconChooser {
const kit = get(response, "data.me.kit");
this.kitMetadata = kit;
this.updateFamilyStyles(get(kit, "release.familyStyles", []));
this.updateFamilyStyles([
{family: 'kit', style: 'custom', prefix: 'fak'},
{family: 'kit-duotone', style: 'custom', prefix: 'fakd'},
]);

const kitFamilyStyles = []
const iconUploads = get(response, "data.me.kit.iconUploads", [])

if (find(iconUploads, (i) => i.pathData.length === 1)) {
kitFamilyStyles.push(
{family: 'kit', style: 'custom', prefix: 'fak'}
)
}

if (find(iconUploads, (i) => i.pathData.length > 1)) {
kitFamilyStyles.push(
{family: 'kit-duotone', style: 'custom', prefix: 'fakd'},
)
}

if(kitFamilyStyles.length > 0) {
this.updateFamilyStyles(kitFamilyStyles);
}
}

updateFamilyStyles(familyStyles: Array<any>) {
Expand Down

0 comments on commit 97baf4f

Please sign in to comment.