From b65a87e38b6e9b9c00a28cddaaababd622277254 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 10 Feb 2025 22:28:58 +0800 Subject: [PATCH] :bug: Fix joining failed joining one of channel fail will stop entire process --- src/pages/realms/[id].tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/realms/[id].tsx b/src/pages/realms/[id].tsx index 4b01fd9..f6cefa9 100644 --- a/src/pages/realms/[id].tsx +++ b/src/pages/realms/[id].tsx @@ -99,15 +99,14 @@ export default function Realm({ realm }: any) { } async function joinChannels() { - try { - for (const chan of checkedChannels) { + for (const chan of checkedChannels) { + try { await sni.post('/cgi/im/channels/' + realm.alias + '/' + chan + '/members', { related: user.account!.name, }) + } catch (err: any) { + console.error(err) } - } catch (err: any) { - console.error(err) - setError(err.toString()) } }