From 6b6028e44be47855a37629f5fc752c8c79e63360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=88=BA=E8=9E=88?= Date: Sat, 21 Dec 2024 23:10:13 +0800 Subject: [PATCH] fix: activityId error show (#42) close #42 --- src/views/snapshot/WindowCard.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/views/snapshot/WindowCard.vue b/src/views/snapshot/WindowCard.vue index ed0b0ef..fbac068 100644 --- a/src/views/snapshot/WindowCard.vue +++ b/src/views/snapshot/WindowCard.vue @@ -103,14 +103,13 @@ const isSystem = computed(() => { return getAppInfo(snapshot.value).isSystem; }); const activityId = computed(() => { - if (!snapshot.value.activityId || !snapshot.value.appId) return ''; - if ( - snapshot.value.activityId.startsWith(snapshot.value.appId) && - snapshot.value.activityId.length > snapshot.value.appId.length - ) { - return snapshot.value.activityId.substring(snapshot.value.appId.length); + const v = snapshot.value.activityId; + const appId = snapshot.value.appId; + if (!v || !appId) return ''; + if (v.startsWith(appId) && v[appId.length] === '.') { + return v.substring(appId.length); } - return snapshot.value.activityId; + return v; }); const onDelete = async () => {