From 71bb1814726ed563c0d67a975d1942ad50dd43ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 13 Dec 2023 18:14:43 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix(frontend):=20MkAnimBg=E3=82=92=E3=83=AA?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=81=95?= =?UTF-8?q?=E3=81=9B=E3=82=8B=20(#12642)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * (fix) MkAnimBgをリサイズに対応させる * fix lint * refactor --- packages/frontend/src/components/MkAnimBg.vue | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/components/MkAnimBg.vue b/packages/frontend/src/components/MkAnimBg.vue index 70d101a9d3..284ee8f3f8 100644 --- a/packages/frontend/src/components/MkAnimBg.vue +++ b/packages/frontend/src/components/MkAnimBg.vue @@ -21,8 +21,9 @@ const props = withDefaults(defineProps<{ focus: 1.0, }); -function loadShader(gl, type, source) { +function loadShader(gl: WebGLRenderingContext, type: number, source: string) { const shader = gl.createShader(type); + if (shader == null) return null; gl.shaderSource(shader, source); gl.compileShader(shader); @@ -38,11 +39,13 @@ function loadShader(gl, type, source) { return shader; } -function initShaderProgram(gl, vsSource, fsSource) { +function initShaderProgram(gl: WebGLRenderingContext, vsSource: string, fsSource: string) { const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource); const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource); const shaderProgram = gl.createProgram(); + if (shaderProgram == null || vertexShader == null || fragmentShader == null) return null; + gl.attachShader(shaderProgram, vertexShader); gl.attachShader(shaderProgram, fragmentShader); gl.linkProgram(shaderProgram); @@ -63,8 +66,10 @@ let handle: ReturnType | null = null; onMounted(() => { const canvas = canvasEl.value!; - canvas.width = canvas.offsetWidth; - canvas.height = canvas.offsetHeight; + let width = canvas.offsetWidth; + let height = canvas.offsetHeight; + canvas.width = width; + canvas.height = height; const gl = canvas.getContext('webgl', { premultipliedAlpha: true }); if (gl == null) return; @@ -197,6 +202,7 @@ onMounted(() => { gl_FragColor = vec4( color, max(max(color.x, color.y), color.z) ); } `); + if (shaderProgram == null) return; gl.useProgram(shaderProgram); const u_resolution = gl.getUniformLocation(shaderProgram, 'u_resolution'); @@ -226,7 +232,23 @@ onMounted(() => { gl!.uniform1f(u_time, 0); gl!.drawArrays(gl!.TRIANGLE_STRIP, 0, 4); } else { - function render(timeStamp) { + function render(timeStamp: number) { + let sizeChanged = false; + if (Math.abs(height - canvas.offsetHeight) > 2) { + height = canvas.offsetHeight; + canvas.height = height; + sizeChanged = true; + } + if (Math.abs(width - canvas.offsetWidth) > 2) { + width = canvas.offsetWidth; + canvas.width = width; + sizeChanged = true; + } + if (sizeChanged && gl) { + gl.uniform2fv(u_resolution, [width, height]); + gl.viewport(0, 0, width, height); + } + gl!.uniform1f(u_time, timeStamp); gl!.drawArrays(gl!.TRIANGLE_STRIP, 0, 4); From 17f894348fcd8fc02ec898079f3ba994074f872b Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 13 Dec 2023 18:21:17 +0900 Subject: [PATCH 2/3] fix(client): fix glitch when attach/detach avatar decoration --- .../settings/profile.avatar-decoration-dialog.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue b/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue index c27a21217b..b7ea4c1521 100644 --- a/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue +++ b/packages/frontend/src/pages/settings/profile.avatar-decoration-dialog.vue @@ -77,19 +77,21 @@ async function attach() { angle: angle.value, flipH: flipH.value, }; + const update = [...$i.avatarDecorations, decoration]; await os.apiWithDialog('i/update', { - avatarDecorations: [...$i.avatarDecorations, decoration], + avatarDecorations: update, }); - $i.avatarDecorations = [...$i.avatarDecorations, decoration]; + $i.avatarDecorations = update; dialog.value.close(); } async function detach() { + const update = $i.avatarDecorations.filter(x => x.id !== props.decoration.id); await os.apiWithDialog('i/update', { - avatarDecorations: $i.avatarDecorations.filter(x => x.id !== props.decoration.id), + avatarDecorations: update, }); - $i.avatarDecorations = $i.avatarDecorations.filter(x => x.id !== props.decoration.id); + $i.avatarDecorations = update; dialog.value.close(); } From 37820ad57216048964edd98232630e311e51ed0f Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 13 Dec 2023 18:31:32 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix(backend):=20=E3=83=A2=E3=83=87=E3=83=AC?= =?UTF-8?q?=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=AD=E3=82=B0=E3=81=8C?= =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AC=E3=83=BC=E3=82=BF=E3=83=BC=E3=81=AF?= =?UTF-8?q?=E9=96=B2=E8=A6=A7=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #12622 --- CHANGELOG.md | 1 + .../src/server/api/endpoints/admin/show-moderation-logs.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5ff09edec..84a6ce35ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -67,6 +67,7 @@ - Fix: チャンネルのノート一覧にてインスタンスミュートが効かない問題 - Fix: 「みつける」が年越し時に壊れる問題を修正 - Fix: アカウントをブロックした際に、自身のユーザーのページでノートが相手に表示される問題を修正 +- Fix: モデレーションログがモデレーターは閲覧できないように修正 ## 2023.11.1 diff --git a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts index f87a5a3574..34c247343a 100644 --- a/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts +++ b/packages/backend/src/server/api/endpoints/admin/show-moderation-logs.ts @@ -14,7 +14,7 @@ export const meta = { tags: ['admin'], requireCredential: true, - requireModerator: true, + requireAdmin: true, res: { type: 'array',