From 44990a1ddb996d7663fe25444b01e5cf2bda7df6 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Mon, 13 Feb 2023 20:26:54 +0100 Subject: [PATCH 1/5] mew --- .../backend/src/server/api/mastodon/endpoints/account.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 7a3df03bdb..8c0111f999 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -308,13 +308,12 @@ export function apiAccountMastodon(router: Router): void { const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw; users = ids; relationshopModel.id = idsRaw?.toString() || "1"; - if (!idsRaw) return [relationshopModel]; - const data = (await client.getRelationships(ids ? ids : [])) as any; + if (!ids) return [relationshopModel]; + const data = await client.getRelationships(ids); ctx.body = data.data; } catch (e: any) { console.error(e); console.error(e.response.data); - e.response.data.user = users ? users : "null"; ctx.status = 401; ctx.body = e.response.data; } From 45929f95f435c9866dcbc54f2613e38cc2b5f2b8 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Mon, 13 Feb 2023 20:36:13 +0100 Subject: [PATCH 2/5] uwu --- .../backend/src/server/api/mastodon/endpoints/account.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 8c0111f999..b089f04774 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -308,7 +308,10 @@ export function apiAccountMastodon(router: Router): void { const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw; users = ids; relationshopModel.id = idsRaw?.toString() || "1"; - if (!ids) return [relationshopModel]; + if (!ids) { + ctx.body = [relationshopModel]; + return; + } const data = await client.getRelationships(ids); ctx.body = data.data; } catch (e: any) { From e923172bec60ce0a9957d5800467a5b4e0318937 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Mon, 13 Feb 2023 20:38:11 +0100 Subject: [PATCH 3/5] actually return value --- packages/backend/src/server/api/mastodon/endpoints/account.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index b089f04774..295a579091 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -308,7 +308,7 @@ export function apiAccountMastodon(router: Router): void { const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw; users = ids; relationshopModel.id = idsRaw?.toString() || "1"; - if (!ids) { + if (!idsRaw) { ctx.body = [relationshopModel]; return; } From 0cc81624b5ba388b106741e33e073bcdafa16f97 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Mon, 13 Feb 2023 20:41:42 +0100 Subject: [PATCH 4/5] try again --- packages/backend/src/server/api/mastodon/endpoints/account.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 295a579091..abb31bb7f2 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -304,11 +304,11 @@ export function apiAccountMastodon(router: Router): void { const client = getClient(BASE_URL, accessTokens); let users; try { - const idsRaw = ctx.query["id[]"]; + const idsRaw = ctx.request.body?["id[]"] : null; const ids = typeof idsRaw === "string" ? [idsRaw] : idsRaw; users = ids; relationshopModel.id = idsRaw?.toString() || "1"; - if (!idsRaw) { + if (!(idsRaw && ids)) { ctx.body = [relationshopModel]; return; } From 9093319906c35df6b999b11464ef8406c3d867b1 Mon Sep 17 00:00:00 2001 From: Free Date: Mon, 13 Feb 2023 21:14:06 +0000 Subject: [PATCH 5/5] Top nav fixes (#9634) Co-authored-by: Free Co-committed-by: Free --- .../client/src/components/global/MkPageHeader.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/client/src/components/global/MkPageHeader.vue b/packages/client/src/components/global/MkPageHeader.vue index 3395ff52bb..8fa3edfe1e 100644 --- a/packages/client/src/components/global/MkPageHeader.vue +++ b/packages/client/src/components/global/MkPageHeader.vue @@ -144,21 +144,20 @@ onMounted(() => { calcBg(); globalEvents.on('themeChanged', calcBg); - watch(() => [props.tab, props.tabs], () => { nextTick(() => { const tabEl = tabRefs[props.tab]; if (tabEl && tabHighlightEl) { // offsetWidth や offsetLeft は少数を丸めてしまうため getBoundingClientRect を使う必要がある // https://developer.mozilla.org/ja/docs/Web/API/HTMLElement/offsetWidth#%E5%80%A4 + const tabSizeX = tabEl.scrollWidth + 20; // + the tab's padding + tabEl.style = `--width: ${tabSizeX}px`; setTimeout(() => { const parentRect = tabsEl.getBoundingClientRect(); const rect = tabEl.getBoundingClientRect(); - const tabSizeX = tabEl.scrollWidth; const left = (rect.left - parentRect.left + tabsEl?.scrollLeft); - tabEl.style = "--width: " + tabSizeX + "px"; tabHighlightEl.style.width = tabSizeX + 'px'; - tabHighlightEl.style.transform = 'translateX(' + left + 'px)'; + tabHighlightEl.style.transform = `translateX(${left}px)`; window.requestAnimationFrame(() => { tabsEl?.scrollTo({left: left - 60, behavior: "smooth"}); }) @@ -358,11 +357,12 @@ onUnmounted(() => { display: inline-flex; align-items: center; position: relative; - padding: 0 10px; + border-inline: 10px solid transparent; height: 100%; font-weight: normal; opacity: 0.7; width: 38px; + --width: 38px; overflow: hidden; transition: color .2s, opacity .2s, width .2s; @@ -384,7 +384,7 @@ onUnmounted(() => { margin-left: 8px; } > .title { - transition: font-size .2s, opacity .2s; + transition: opacity .2s; } }