From 7981d4df041dae6c40f34700d3b3ebdc2b99ad07 Mon Sep 17 00:00:00 2001 From: Felix Mosheev <9304194+felixmosh@users.noreply.github.com> Date: Sat, 5 Feb 2022 22:23:08 +0200 Subject: [PATCH] fix: decode queue name to support url special chars, closes #375 --- packages/api/src/handlers/queues.ts | 4 +++- packages/ui/src/hooks/useActiveQueue.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/api/src/handlers/queues.ts b/packages/api/src/handlers/queues.ts index c0ecc706..f1fbc90f 100644 --- a/packages/api/src/handlers/queues.ts +++ b/packages/api/src/handlers/queues.ts @@ -95,7 +95,9 @@ async function getAppQueues( ): Promise { return Promise.all( pairs.map(async ([queueName, queue]) => { - const isActiveQueue = query.activeQueue === queueName; + const isActiveQueue = decodeURIComponent(query.activeQueue) === queueName; + console.log({ isActiveQueue }, queueName); + console.log({ status: query.status }); const status = !isActiveQueue || query.status === 'latest' ? allStatuses : [query.status as JobStatus]; diff --git a/packages/ui/src/hooks/useActiveQueue.ts b/packages/ui/src/hooks/useActiveQueue.ts index 9a23b7af..05f8ef0b 100644 --- a/packages/ui/src/hooks/useActiveQueue.ts +++ b/packages/ui/src/hooks/useActiveQueue.ts @@ -9,5 +9,5 @@ export function useActiveQueue(): string | undefined { strict: true, }); - return match?.params.name; + return decodeURIComponent(match?.params.name || '') || undefined; }