mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Added BRC_NO_POOL error
This commit is contained in:
@@ -25,6 +25,7 @@ const debugMessages: MessageGroup = {
|
|||||||
BRC_FORMATTYPE_UNMATCH: "Format must be a string or null. Cannot set backward compatibility.",
|
BRC_FORMATTYPE_UNMATCH: "Format must be a string or null. Cannot set backward compatibility.",
|
||||||
BRC_AUTC_MISSING_DATA: "Unable to autogenerate barcodes. Data is not a string.",
|
BRC_AUTC_MISSING_DATA: "Unable to autogenerate barcodes. Data is not a string.",
|
||||||
BRC_BW_FORMAT_UNSUPPORTED: "This format is not supported (by Apple) for backward support. Please choose another one.",
|
BRC_BW_FORMAT_UNSUPPORTED: "This format is not supported (by Apple) for backward support. Please choose another one.",
|
||||||
|
BRC_NO_POOL: "Cannot set barcode: no barcodes found. Please set barcodes first. Barcode is for retrocompatibility only.",
|
||||||
DATE_FORMAT_UNMATCH: "%s was not set due to incorrect date format."
|
DATE_FORMAT_UNMATCH: "%s was not set due to incorrect date format."
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -415,6 +415,11 @@ export class Pass implements PassIndexSignature {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(barcodes && barcodes.length)) {
|
||||||
|
barcodeDebug(formatMessage("BRC_NO_POOL"))
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
// Checking which object among barcodes has the same format of the specified one.
|
// Checking which object among barcodes has the same format of the specified one.
|
||||||
const index = barcodes.findIndex(b => b.format.toLowerCase().includes(chosenFormat.toLowerCase()));
|
const index = barcodes.findIndex(b => b.format.toLowerCase().includes(chosenFormat.toLowerCase()));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user