mirror of https://github.com/iconify/api.git
chore: allow updating specific importer
This commit is contained in:
parent
c5260541b8
commit
e44822a40d
|
|
@ -125,7 +125,7 @@ export function updateIconSets(): number {
|
||||||
/**
|
/**
|
||||||
* Trigger update
|
* Trigger update
|
||||||
*/
|
*/
|
||||||
export function triggerIconSetsUpdate(done?: (success?: boolean) => void) {
|
export function triggerIconSetsUpdate(index?: number | null, done?: (success?: boolean) => void) {
|
||||||
if (!importers) {
|
if (!importers) {
|
||||||
done?.();
|
done?.();
|
||||||
return;
|
return;
|
||||||
|
|
@ -141,6 +141,9 @@ export function triggerIconSetsUpdate(done?: (success?: boolean) => void) {
|
||||||
// Check for updates
|
// Check for updates
|
||||||
let updated = false;
|
let updated = false;
|
||||||
for (let i = 0; i < importers?.length; i++) {
|
for (let i = 0; i < importers?.length; i++) {
|
||||||
|
if (typeof index === 'number' && i !== index) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
updated = (await importers[i].checkForUpdate()) || updated;
|
updated = (await importers[i].checkForUpdate()) || updated;
|
||||||
}
|
}
|
||||||
return updated;
|
return updated;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue