From 3724cc7fe7f290d617e6de794a204ebe94b3bf80 Mon Sep 17 00:00:00 2001 From: Benny Samir Hierl Date: Tue, 15 Dec 2020 10:30:28 +0100 Subject: [PATCH] update apple store order status Signed-off-by: Benny Samir Hierl --- Apple-Order-Status/Apple-Store-Order-Status.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Apple-Order-Status/Apple-Store-Order-Status.js b/Apple-Order-Status/Apple-Store-Order-Status.js index 390e1a2..4d3155c 100644 --- a/Apple-Order-Status/Apple-Store-Order-Status.js +++ b/Apple-Order-Status/Apple-Store-Order-Status.js @@ -1,7 +1,7 @@ // Variables used by Scriptable. // These must be at the very top of the file. Do not edit. // icon-color: deep-blue; icon-glyph: shopping-cart; -// Version 1.1.3 +// Version 1.1.4 const cacheMinutes = 60 * 2 const today = new Date() @@ -10,16 +10,19 @@ const h = 5 const debug = false if (config.widgetFamily === 'small') { - width = 100 + width = 200 } else { - width = 300 + width = 400 } //////////////////////////////////////////////////////////// let widgetInputRAW = args.widgetParameter; let widgetInput; if (widgetInputRAW !== null) { - widgetInput = widgetInputRAW.toString().trim().split(';') - + widgetInput = widgetInputRAW.toString().trim().split(';').map(v => v.trim()) + + if (!/^[A-Za-z][0-9]+/.test(widgetInput[0])) { + throw new Error('Invalid ordernumber format: "' + widgetInput[0] + '"') + } if (widgetInput[2] && !/^[\d]+$/.test(widgetInput[2])) { throw new Error('Third parameter has to be a number') }