tweak 647f8958
This commit is contained in:
parent
c0daffd9e5
commit
da70e21c7d
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue