Skip to content

Commit 7257b49

Browse files
authored
Simplify maskable icon processing checks
1 parent 66c4b60 commit 7257b49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/files/manifest.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,18 @@ export const createManifest = async (context, config, queue, options) => {
2727

2828
// maskableIcon can now be boolean or an icon path.
2929
// if it is true, or is the same icon file as standard icon, set 'maskable any'
30+
// also revert maskableIconName to null, as we won't need to process separately
3031
if (options.maskableIcon === true || options.maskableIcon === options.icon) {
3132
purpose = 'maskable any'
33+
maskableIconName = null
3234
}
3335

3436
// add and process { icon }
3537
icons.push({src, type, sizes, purpose});
3638
const results = [sharp(options.icon).resize(size, size).toFile(imagePath)]
3739

3840
// if maskableIcon is a string, then we need to process it as a separate maskable icon
39-
if (options.maskableIcon && typeof options.maskableIcon === 'string') {
41+
if (maskableIconName) {
4042
imagePath = path.join(iconsDir, rename(maskableIconName, { suffix: `-maskable-${sizes}` }))
4143
src = path.relative(config.outputDir, imagePath);
4244
type = 'image/' + maskableIconName.split('.').slice(-1)[0];

0 commit comments

Comments
 (0)