From 555babcb23f473da2f3077c01030025dfe2fff68 Mon Sep 17 00:00:00 2001 From: Rodrigo Rodriguez Date: Sun, 10 Dec 2023 20:24:48 -0300 Subject: [PATCH] fix(basic.gblib): Allow MERGE keyword in storage #380. @othonlima --- packages/basic.gblib/services/GBVMService.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/basic.gblib/services/GBVMService.ts b/packages/basic.gblib/services/GBVMService.ts index 046bbcd9..8c58abb2 100644 --- a/packages/basic.gblib/services/GBVMService.ts +++ b/packages/basic.gblib/services/GBVMService.ts @@ -590,8 +590,9 @@ export class GBVMService extends GBService { const tokenStops = {}; // Setups refresh token mechanism. - - const tokens = this.variables['tokens']; + console.log(1); + console.log(this.variables['tokens']); + const tokens = this.variables['tokens'].split(','); const interval = 60000; // 1 hour. for(i in tokens) { @@ -944,8 +945,10 @@ export class GBVMService extends GBService { const strFind = ' Client ID'; const tokens = await min.core['findParam'](min.instance, strFind); + let tokensList = []; await CollectionUtil.asyncForEach(tokens, async t => { const tokenName = t.replace(strFind, ''); + tokensList.push(tokenName); try { variables[tokenName] = await sys.getCustomToken({pid, tokenName}); } catch (error) { @@ -953,7 +956,7 @@ export class GBVMService extends GBService { } }); - sandbox['tokens'] = tokens; + sandbox['tokens'] = tokensList.join(','); sandbox['variables'] = variables; sandbox['id'] = sys.getRandomId(); sandbox['username'] = await dk.userName({ pid });