fix
This commit is contained in:
parent
c464e7d31e
commit
28b181ee7a
|
@ -49,7 +49,7 @@ const relative = $computed<string>(() => {
|
||||||
let tickId: number;
|
let tickId: number;
|
||||||
|
|
||||||
function tick() {
|
function tick() {
|
||||||
const _now = (props.origin ?? new Date()).getTime()
|
const _now = (new Date()).getTime();
|
||||||
const ago = (_now - _time) / 1000/*ms*/;
|
const ago = (_now - _time) / 1000/*ms*/;
|
||||||
const next = ago < 60 ? 10000 : ago < 3600 ? 60000 : 180000;
|
const next = ago < 60 ? 10000 : ago < 3600 ? 60000 : 180000;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ function tick() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!invalid && (props.mode === 'relative' || props.mode === 'detail')) {
|
if (!invalid && props.origin === null && (props.mode === 'relative' || props.mode === 'detail')) {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
tickId = window.setInterval(tick, 10000);
|
tickId = window.setInterval(tick, 10000);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue