From 610f208c57fd3f46c3ef7f7b9c5d71207a893a33 Mon Sep 17 00:00:00 2001 From: Marie Date: Thu, 25 Jan 2024 14:23:51 +0100 Subject: [PATCH] fix: don't let user invite themself to reversi game --- packages/frontend/src/os.ts | 1 + packages/frontend/src/pages/reversi/index.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 2f41eaef29..1d42c7e4d5 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -423,6 +423,7 @@ export async function selectUser(opts: { includeSelf?: boolean, local?: boolean return new Promise((resolve, reject) => { popup(defineAsyncComponent(() => import('@/components/MkUserSelectDialog.vue')), { includeSelf: opts.includeSelf, + local: opts.local, }, { ok: user => { resolve(user); diff --git a/packages/frontend/src/pages/reversi/index.vue b/packages/frontend/src/pages/reversi/index.vue index d1b784f633..c9a6012e75 100644 --- a/packages/frontend/src/pages/reversi/index.vue +++ b/packages/frontend/src/pages/reversi/index.vue @@ -193,7 +193,7 @@ async function matchHeatbeat() { } async function matchUser() { - const user = await os.selectUser({ local: true }); + const user = await os.selectUser({ local: true, includeSelf: false }); if (user == null) return; matchingUser.value = user;