mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-06 16:16:42 +08:00
fix(subscribe): reactive update for subscribeState and lastUpdateText
This commit is contained in:
@@ -38,11 +38,11 @@ const subscribeFilesDialog = ref(false)
|
|||||||
// 分享订阅弹窗
|
// 分享订阅弹窗
|
||||||
const subscribeShareDialog = ref(false)
|
const subscribeShareDialog = ref(false)
|
||||||
|
|
||||||
// 定义一个变量来保存当前的订阅状态
|
// 当前的订阅状态
|
||||||
const subscribeState = ref<string>(props.media?.state ?? 'P')
|
const subscribeState = ref<string>(props.media?.state ?? 'P')
|
||||||
|
|
||||||
// 上一次更新时间
|
// 上一次更新时间
|
||||||
const lastUpdateText = ref(props.media && props.media.last_update ? formatDateDifference(props.media.last_update) : '')
|
const lastUpdateText = computed(() => (props.media?.last_update ? formatDateDifference(props.media.last_update) : ''))
|
||||||
|
|
||||||
// 图片加载完成响应
|
// 图片加载完成响应
|
||||||
function imageLoadHandler() {
|
function imageLoadHandler() {
|
||||||
@@ -239,6 +239,14 @@ watch(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 监听订阅状态
|
||||||
|
watch(
|
||||||
|
() => props.media?.state,
|
||||||
|
newState => {
|
||||||
|
subscribeState.value = newState ?? 'P'
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
// 计算backdrop图片地址
|
// 计算backdrop图片地址
|
||||||
const backdropUrl = computed(() => {
|
const backdropUrl = computed(() => {
|
||||||
const url = props.media?.backdrop || props.media?.poster
|
const url = props.media?.backdrop || props.media?.poster
|
||||||
|
|||||||
Reference in New Issue
Block a user