Skip to content

Commit 9a01b01

Browse files
authored
Merge pull request #17 from WickrInc/await-get-client-state
fix: await getClientState, update github actions
2 parents 4b8a2bd + 6fa9a87 commit 9a01b01

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

.github/workflows/npm-publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,26 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
1315
steps:
1416
- uses: actions/checkout@v2
1517
- uses: actions/setup-node@v1
1618
with:
17-
node-version: 16
19+
node-version: 20
1820
- run: npm ci
1921
- run: npm test
2022

2123
publish-npm:
2224
needs: build
2325
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
2428
steps:
2529
- uses: actions/checkout@v2
2630
- uses: actions/setup-node@v1
2731
with:
28-
node-version: 16
32+
node-version: 20
2933
registry-url: https://registry.npmjs.org/
3034
- run: npm ci
3135
- run: npm publish

lib/bot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class WickrBot extends EventEmitter {
2121
}
2222

2323
async start() {
24-
await this.wickr.clientInit(this.username)
24+
this.wickr.clientInit(this.username)
2525
await this.waitForState('RUNNING')
2626
this.emit('start')
2727
}
@@ -341,7 +341,7 @@ class WickrBot extends EventEmitter {
341341
}
342342

343343
async waitForState(state, retries=10, interval=1000, exponential=true) {
344-
const curState = this.wickr.getClientState()
344+
const curState = await this.wickr.getClientState()
345345

346346
if (curState === state) return
347347
else if (retries) {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wickrbot",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Framework for WickrIO bots",
55
"main": "lib/bot.js",
66
"types": "types/index.d.ts",

0 commit comments

Comments
 (0)