summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/core/command/getConfig.lua7
-rw-r--r--script/core/command/setConfig.lua6
2 files changed, 8 insertions, 5 deletions
diff --git a/script/core/command/getConfig.lua b/script/core/command/getConfig.lua
index dd0b504b..7a35c198 100644
--- a/script/core/command/getConfig.lua
+++ b/script/core/command/getConfig.lua
@@ -1,10 +1,13 @@
local config = require 'config'
-local ws = require 'workspace'
+local client = require 'client'
+local await = require 'await'
---@async
return function (data)
local uri = data[1].uri
local key = data[1].key
- ws.awaitReady(uri)
+ while not client:isReady() do
+ await.sleep(0.1)
+ end
return config.get(uri, key)
end
diff --git a/script/core/command/setConfig.lua b/script/core/command/setConfig.lua
index c61aa942..af978ebe 100644
--- a/script/core/command/setConfig.lua
+++ b/script/core/command/setConfig.lua
@@ -1,11 +1,11 @@
local client = require 'client'
-local ws = require 'workspace'
+local await = require 'await'
---@async
---@param changes config.change[]
return function (changes)
- for _, change in ipairs(changes) do
- ws.awaitReady(change.uri)
+ while not client:isReady() do
+ await.sleep(0.1)
end
client.setConfig(changes)
end