summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md4
-rw-r--r--script/client.lua6
-rw-r--r--script/library.lua8
3 files changed, 11 insertions, 7 deletions
diff --git a/changelog.md b/changelog.md
index 85b126b0..696295c3 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,9 @@
# changelog
+## 2.2.1
+`2021-7-8`
+* `FIX` change setting may failed
+
## 2.2.0
`2021-7-8`
* `NEW` detect and apply third-party libraries, including:
diff --git a/script/client.lua b/script/client.lua
index f5078d48..1928910f 100644
--- a/script/client.lua
+++ b/script/client.lua
@@ -105,8 +105,8 @@ end
---@field uri? uri
---@param changes config.change[]
----@param updateLocal boolean
-function m.setConfig(changes, updateLocal)
+---@param onlyMemory boolean
+function m.setConfig(changes, onlyMemory)
local finalChanges = {}
for _, change in ipairs(changes) do
if change.action == 'add' then
@@ -121,7 +121,7 @@ function m.setConfig(changes, updateLocal)
end
end
end
- if not updateLocal then
+ if onlyMemory then
return
end
if #finalChanges == 0 then
diff --git a/script/library.lua b/script/library.lua
index 3cb4cb10..80a34032 100644
--- a/script/library.lua
+++ b/script/library.lua
@@ -294,7 +294,7 @@ local function load3rdConfig()
return configs
end
-local function apply3rd(cfg, localConfig)
+local function apply3rd(cfg, onlyMemory)
local changes = {}
for _, change in ipairs(cfg.configs) do
changes[#changes+1] = change
@@ -314,7 +314,7 @@ local function apply3rd(cfg, localConfig)
value = ('${3rd}/%s/library'):format(cfg.name),
}
- client.setConfig(changes, localConfig)
+ client.setConfig(changes, onlyMemory)
end
local hasAsked
@@ -338,9 +338,9 @@ local function askFor3rd(cfg)
},
}
if result == yes1 then
- apply3rd(cfg, true)
- elseif result == yes2 then
apply3rd(cfg, false)
+ elseif result == yes2 then
+ apply3rd(cfg, true)
end
end