mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-27 20:09:03 +00:00
16 lines
363 B
JavaScript
16 lines
363 B
JavaScript
|
import log from 'loglevel';
|
||
|
import { inferIcon } from './../../infer';
|
||
|
|
||
|
export default function ({ icon, targetUrl, platform }) {
|
||
|
// Icon is the path to the icon
|
||
|
if (icon) {
|
||
|
return icon;
|
||
|
}
|
||
|
|
||
|
return inferIcon(targetUrl, platform)
|
||
|
.catch((error) => {
|
||
|
log.warn('Cannot automatically retrieve the app icon:', error);
|
||
|
return null;
|
||
|
});
|
||
|
}
|