Skip to content

Commit efd6c91

Browse files
committed
just check client ready
1 parent 95e3888 commit efd6c91

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

script/core/command/getConfig.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
local config = require 'config'
2-
local ws = require 'workspace'
2+
local client = require 'client'
3+
local await = require 'await'
34

45
---@async
56
return function (data)
67
local uri = data[1].uri
78
local key = data[1].key
8-
ws.awaitReady(uri)
9+
while not client:isReady() do
10+
await.sleep(0.1)
11+
end
912
return config.get(uri, key)
1013
end

script/core/command/setConfig.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
local client = require 'client'
2-
local ws = require 'workspace'
2+
local await = require 'await'
33

44
---@async
55
---@param changes config.change[]
66
return function (changes)
7-
for _, change in ipairs(changes) do
8-
ws.awaitReady(change.uri)
7+
while not client:isReady() do
8+
await.sleep(0.1)
99
end
1010
client.setConfig(changes)
1111
end

0 commit comments

Comments
 (0)