Nativefier/src/options/fields/icon.js

15 lines
366 B
JavaScript
Raw Normal View History

import log from 'loglevel';
2018-07-21 15:16:02 +02:00
import { inferIcon } from '../../infer';
2018-05-24 09:02:44 +02:00
export default function({ icon, targetUrl, platform }) {
// Icon is the path to the icon
if (icon) {
return Promise.resolve(icon);
}
2018-05-24 09:02:44 +02:00
return inferIcon(targetUrl, platform).catch((error) => {
log.warn('Cannot automatically retrieve the app icon:', error);
return null;
});
}