Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stores/infra.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const use_infra_store = defineStore("infra", {
actions: {
async create_backend() {
if (this.status === Status.CREATED) return
navigator.locks.request("infra.create_backend", async (lock) => {
return navigator.locks.request("infra.create_backend", async (lock) => {
this.status = Status.CREATING
if (this.status === Status.CREATED) return
console.log("LOCK GRANTED !", lock)
Expand Down
2 changes: 1 addition & 1 deletion stores/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const use_viewer_store = defineStore("viewer", {
async ws_connect() {
if (process.env.NODE_ENV == "test") return
if (this.status === Status.CONNECTED) return
navigator.locks.request("viewer.ws_connect", async (lock) => {
return navigator.locks.request("viewer.ws_connect", async (lock) => {
if (this.status === Status.CONNECTED) return
console.log("VIEWER LOCK GRANTED !", lock)
this.status = Status.CONNECTING
Expand Down
6 changes: 3 additions & 3 deletions test/stores/Infra.nuxt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ describe("Infra Store", () => {
test("test without end-point", async () => {
await infra_store.create_backend()
console.log("geode_store.status", geode_store.status)
expect(infra_store.status).toBe(Status.CREATING)
expect(infra_store.status).toBe(Status.NOT_CREATED)
expect(geode_store.status).toBe(Status.NOT_CONNECTED)
expect(viewer_store.status).toBe(Status.NOT_CONNECTED)
})
Expand All @@ -133,10 +133,10 @@ describe("Infra Store", () => {
handler: () => ({ ID: "123456" }),
})
await infra_store.create_backend()
expect(infra_store.status).toBe(Status.CREATING)
expect(infra_store.status).toBe(Status.CREATED)
expect(geode_store.status).toBe(Status.NOT_CONNECTED)
expect(viewer_store.status).toBe(Status.NOT_CONNECTED)
expect(feedback_store.server_error).toBe(false)
expect(feedback_store.server_error).toBe(true)
})
})
})
Expand Down