This commit is contained in:
NoriDev 2023-10-25 18:14:36 +09:00
parent c0daffd9e5
commit da70e21c7d

View file

@ -26,6 +26,8 @@ SPDX-License-Identifier: AGPL-3.0-only
import { onMounted, onUnmounted } from 'vue';
import { deviceKind } from '@/scripts/device-kind.js';
import { i18n } from '@/i18n.js';
import { vibrate } from '@/scripts/vibrate.js';
import { ColdDeviceStorage } from '@/store.js';
const SCROLL_STOP = 10;
const MAX_PULL_DISTANCE = Infinity;
@ -45,6 +47,8 @@ let scrollEl: HTMLElement | null = null;
let disabled = false;
let isVibrate = false;
const emits = defineEmits<{
(ev: 'refresh'): void;
}>();
@ -147,6 +151,12 @@ function moving(event) {
currentHeight = Math.min(Math.max(moveHeight, 0), MAX_PULL_DISTANCE);
isPullEnd = currentHeight >= FIRE_THRESHOLD;
if (!isPullEnd) isVibrate = false;
else if (isPullEnd && !isVibrate) {
vibrate(ColdDeviceStorage.get('vibrateSystem') ? 150 : []);
isVibrate = true;
}
}
/**