From e3c3702ec9858907504a38e6d5f03d23a4975f29 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 23 Oct 2023 20:02:56 +0900 Subject: [PATCH] refactor --- packages/frontend/src/components/MkPullToRefresh.vue | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/frontend/src/components/MkPullToRefresh.vue b/packages/frontend/src/components/MkPullToRefresh.vue index 493f622819..b00523c0d3 100644 --- a/packages/frontend/src/components/MkPullToRefresh.vue +++ b/packages/frontend/src/components/MkPullToRefresh.vue @@ -137,13 +137,7 @@ function moving(event) { const moveScreenY = getScreenY(event); const moveHeight = moveScreenY - startScreenY!; - if (moveHeight < 0) { - currentHeight = 0; - } else if (moveHeight >= maxFrameSize) { - currentHeight = maxFrameSize; - } else { - currentHeight = moveHeight; - } + currentHeight = Math.min(Math.max(moveHeight, 0), maxFrameSize); isPullEnd = currentHeight >= refreshFrameSize; }