goto-assistant 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/setup.html +1 -1
- package/public/setup.js +8 -3
package/package.json
CHANGED
package/public/setup.html
CHANGED
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
// Thin wrapper that passes mutable state to the extracted syncCronConfig
|
|
82
82
|
function doSyncCronConfig() {
|
|
83
83
|
servers = readServers();
|
|
84
|
-
servers = syncCronConfig(servers, isEditing, buildCronConfig);
|
|
84
|
+
servers = syncCronConfig(servers, isEditing, buildCronConfig, window._savedConfig);
|
|
85
85
|
renderServers(servers);
|
|
86
86
|
}
|
|
87
87
|
|
package/public/setup.js
CHANGED
|
@@ -72,7 +72,7 @@ function readServers() {
|
|
|
72
72
|
// Sync cron server config. Takes servers array, isEditing flag, and buildCronConfigFn.
|
|
73
73
|
// Returns updated servers array (mutates in place for convenience, also returns).
|
|
74
74
|
// eslint-disable-next-line no-unused-vars
|
|
75
|
-
function syncCronConfig(servers, isEditing, buildCronConfigFn) {
|
|
75
|
+
function syncCronConfig(servers, isEditing, buildCronConfigFn, savedConfig) {
|
|
76
76
|
var cron = servers.find(function (s) { return s.name === 'cron'; });
|
|
77
77
|
if (!cron) return servers;
|
|
78
78
|
|
|
@@ -98,9 +98,14 @@ function syncCronConfig(servers, isEditing, buildCronConfigFn) {
|
|
|
98
98
|
oldKeys.forEach(function (k) { delete cron.env[k]; });
|
|
99
99
|
cron.env[result.envKey] = result.envValue;
|
|
100
100
|
} else if (oldKeys.length > 0 && oldKeys[0] !== result.envKey) {
|
|
101
|
-
|
|
101
|
+
// Use the target provider's masked key from savedConfig when available
|
|
102
|
+
var targetValue = cron.env[oldKeys[0]];
|
|
103
|
+
if (savedConfig) {
|
|
104
|
+
var pc = savedConfig[provider] || {};
|
|
105
|
+
if (pc.apiKey) targetValue = pc.apiKey;
|
|
106
|
+
}
|
|
102
107
|
oldKeys.forEach(function (k) { delete cron.env[k]; });
|
|
103
|
-
cron.env[result.envKey] =
|
|
108
|
+
cron.env[result.envKey] = targetValue;
|
|
104
109
|
}
|
|
105
110
|
|
|
106
111
|
return servers;
|