Skip to content

Commit

Permalink
Only use parse.icon when it exists
Browse files Browse the repository at this point in the history
Not sure when this was added putting some protection around it.
  • Loading branch information
jrjohnson committed Apr 25, 2022
1 parent cf43be6 commit 420e236
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions addon/components/fa-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,22 @@ function normalizeIconArgs(prefix, icon) {
return icon;
}

if (parse.icon) {
if (typeof prefix === 'string' && typeof icon === 'string') {
return parse.icon({ prefix: prefix, iconName: icon });
}

if (typeof icon === 'string') {
return parse.icon({ prefix: defaultPrefix, iconName: icon });
}
}

if (typeof prefix === 'string' && typeof icon === 'string') {
return parse.icon({ prefix: prefix, iconName: icon });
return { prefix: prefix, iconName: icon };
}

if (typeof icon === 'string') {
return parse.icon({ prefix: defaultPrefix, iconName: icon });
return { prefix: defaultPrefix, iconName: icon };
}
}

Expand Down

0 comments on commit 420e236

Please sign in to comment.