add UUID to Config and Cache Name

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2020-12-28 21:33:01 +01:00
parent 5395257a56
commit 57b7da9f88
No known key found for this signature in database
GPG key ID: 69DE3C3C097DB7F7

View file

@ -13,6 +13,7 @@ Changelog:
- use MSISDN for Cache-Name
- show amount for prepaid cards
- show remaining days as progress-bar
- Setup assistent
v1.2.4:
- use color.dynamic
v1.2.3:
@ -82,7 +83,7 @@ config.widgetFamily = config.widgetFamily || 'small'
let widgetInputRAW = args.widgetParameter;
let widgetInput = null;
let user, pass, number, json
let user, pass, number, json, cacheUUID
if (widgetInputRAW !== null) {
const parameter = widgetInputRAW.toString().split("|")
if(parameter.length > 1) {
@ -100,7 +101,7 @@ if (widgetInputRAW !== null) {
if (json) {
try {
const c = JSON.parse(json)
cacheUUID = c.uuid || null
containerList = c.containerList || containerList
codeList = c.codeList || codeList
darkModeSupport = c.darkModeSupport !== undefined ? c.darkModeSupport : darkModeSupport
@ -288,6 +289,7 @@ async function setupAssistant () {
const codeList = [...new Set(selectedList.map(x => x.code))]
const options = {
uuid: UUID.string(),
containerList,
codeList
}
@ -576,7 +578,7 @@ var today = new Date()
const files = FileManager.local()
// Set up cache
const cacheNamePostfix = (number) ? number.substr(number.length - 4) : 'networkLogin'
const cacheNamePostfix = ((number) ? number.substr(number.length - 4) : 'networkLogin') + ( cacheUUID ? `-${cacheUUID}` : '')
const cachePath = files.joinPath(files.documentsDirectory(), "widget-vodafone-" + cacheNamePostfix)
const cacheExists = files.fileExists(cachePath)
const cacheDate = cacheExists ? files.modificationDate(cachePath) : 0