aktueller stand
This commit is contained in:
@@ -14,11 +14,13 @@ const DEFAULT_SETTINGS = {
|
||||
storeWatchInitialDelayMinSeconds: 10,
|
||||
storeWatchInitialDelayMaxSeconds: 60,
|
||||
storeWatchRequestDelayMs: 1000,
|
||||
storeWatchStatusCacheMaxAgeMinutes: 120,
|
||||
storePickupCheckDelayMs: 400,
|
||||
ignoredSlots: [
|
||||
{
|
||||
storeId: '51450',
|
||||
description: 'TVS'
|
||||
slotName: 'TVS',
|
||||
info: ''
|
||||
}
|
||||
],
|
||||
notifications: {
|
||||
@@ -56,11 +58,15 @@ function sanitizeIgnoredSlots(slots = []) {
|
||||
return DEFAULT_SETTINGS.ignoredSlots;
|
||||
}
|
||||
return slots
|
||||
.map((slot) => ({
|
||||
storeId: slot?.storeId ? String(slot.storeId) : '',
|
||||
description: slot?.description ? String(slot.description) : ''
|
||||
}))
|
||||
.filter((slot) => slot.storeId);
|
||||
.map((slot) => {
|
||||
const slotName = slot?.slotName ?? slot?.description;
|
||||
return {
|
||||
storeId: slot?.storeId ? String(slot.storeId) : '',
|
||||
slotName: slotName ? String(slotName) : '',
|
||||
info: slot?.info ? String(slot.info) : ''
|
||||
};
|
||||
})
|
||||
.filter((slot) => slot.storeId && slot.slotName);
|
||||
}
|
||||
|
||||
function sanitizeString(value) {
|
||||
@@ -120,6 +126,10 @@ function readSettings() {
|
||||
parsed.storeWatchRequestDelayMs,
|
||||
DEFAULT_SETTINGS.storeWatchRequestDelayMs
|
||||
),
|
||||
storeWatchStatusCacheMaxAgeMinutes: sanitizeNumber(
|
||||
parsed.storeWatchStatusCacheMaxAgeMinutes,
|
||||
DEFAULT_SETTINGS.storeWatchStatusCacheMaxAgeMinutes
|
||||
),
|
||||
storePickupCheckDelayMs: sanitizeNumber(
|
||||
parsed.storePickupCheckDelayMs,
|
||||
DEFAULT_SETTINGS.storePickupCheckDelayMs
|
||||
@@ -154,6 +164,10 @@ function writeSettings(patch = {}) {
|
||||
patch.storeWatchRequestDelayMs,
|
||||
current.storeWatchRequestDelayMs
|
||||
),
|
||||
storeWatchStatusCacheMaxAgeMinutes: sanitizeNumber(
|
||||
patch.storeWatchStatusCacheMaxAgeMinutes,
|
||||
current.storeWatchStatusCacheMaxAgeMinutes
|
||||
),
|
||||
storePickupCheckDelayMs: sanitizeNumber(
|
||||
patch.storePickupCheckDelayMs,
|
||||
current.storePickupCheckDelayMs
|
||||
|
||||
Reference in New Issue
Block a user