What you pay for, what Discord drops, and pixiv switched off #251
@@ -33,10 +33,10 @@
|
|||||||
never synced
|
never synced
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="!p.fresh" class="fc-roster__stale">
|
<span v-else-if="!p.fresh" class="fc-roster__stale">
|
||||||
last synced {{ ago(p.last_success_at) }} — too old to rely on
|
last synced {{ formatRelative(p.last_success_at) }} — too old to rely on
|
||||||
</span>
|
</span>
|
||||||
<span v-else class="fc-roster__ok">
|
<span v-else class="fc-roster__ok">
|
||||||
synced {{ ago(p.last_success_at) }}
|
synced {{ formatRelative(p.last_success_at) }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
{{ p.last_count }} membership{{ p.last_count === 1 ? '' : 's' }} found
|
{{ p.last_count }} membership{{ p.last_count === 1 ? '' : 's' }} found
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="p.last_attempt_at">
|
<template v-else-if="p.last_attempt_at">
|
||||||
tried {{ ago(p.last_attempt_at) }}, no successful sync yet
|
tried {{ formatRelative(p.last_attempt_at) }}, no successful sync yet
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -68,18 +68,12 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
|
import { formatRelative } from '../../utils/date.js'
|
||||||
import { useMembershipSyncStore } from '../../stores/membershipSync.js'
|
import { useMembershipSyncStore } from '../../stores/membershipSync.js'
|
||||||
import MaintenanceTile from '../common/MaintenanceTile.vue'
|
import MaintenanceTile from '../common/MaintenanceTile.vue'
|
||||||
|
|
||||||
const store = useMembershipSyncStore()
|
const store = useMembershipSyncStore()
|
||||||
|
|
||||||
function ago (iso) {
|
|
||||||
const diff = (Date.now() - new Date(iso).getTime()) / 1000
|
|
||||||
if (diff < 3600) return `${Math.max(1, Math.floor(diff / 60))}m ago`
|
|
||||||
if (diff < 86400) return `${Math.floor(diff / 3600)}h ago`
|
|
||||||
return `${Math.floor(diff / 86400)}d ago`
|
|
||||||
}
|
|
||||||
|
|
||||||
async function refresh () {
|
async function refresh () {
|
||||||
await store.syncNow()
|
await store.syncNow()
|
||||||
await store.load()
|
await store.load()
|
||||||
|
|||||||
Reference in New Issue
Block a user