Skip to content

Commit ec00e2e

Browse files
committed
ensuring that the sprite is not added more than once
1 parent 310231e commit ec00e2e

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/components/addon-main.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ const flightIconSprite = require('@hashicorp/flight-icons/svg-sprite/svg-sprite-
99
module.exports = {
1010
...addonV1Shim(__dirname),
1111
contentFor(type, config) {
12-
if (!config.emberFlightIcons?.lazyEmbed && type === 'body-footer') {
12+
if (
13+
!config.emberFlightIcons?.lazyEmbed &&
14+
!config.__flightIconsSpriteLoaded &&
15+
type === 'body-footer'
16+
) {
17+
config.__flightIconsSpriteLoaded = true;
18+
1319
return flightIconSprite;
1420
}
1521
},

packages/ember-flight-icons/addon-main.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ const flightIconSprite = require('@hashicorp/flight-icons/svg-sprite/svg-sprite-
88
module.exports = {
99
...addonV1Shim(__dirname),
1010
contentFor(type, config) {
11-
if (!config.emberFlightIcons?.lazyEmbed && type === 'body-footer') {
11+
if (
12+
!config.emberFlightIcons?.lazyEmbed &&
13+
!config.__flightIconsSpriteLoaded &&
14+
type === 'body-footer'
15+
) {
16+
config.__flightIconsSpriteLoaded = true;
17+
1218
return flightIconSprite;
1319
}
1420
},

0 commit comments

Comments
 (0)