mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-03-15 03:53:16 +08:00
🚨 尝试修复Sentry报错
Cannot read properties of undefined (reading 'upvote_type')
This commit is contained in:
@@ -226,7 +226,7 @@ async function tryAuto(skip: boolean = false): Promise<void> {
|
|||||||
}
|
}
|
||||||
viewCnt++;
|
viewCnt++;
|
||||||
if (likeCnt < 5) {
|
if (likeCnt < 5) {
|
||||||
const isLike = detailResp.self_operation.upvote_type === 1;
|
const isLike = (detailResp.self_operation?.upvote_type ?? 0) > 0;
|
||||||
if (isLike) {
|
if (isLike) {
|
||||||
await TGLogger.Script(`[米游币任务]帖子${post.post.post_id}已点赞,跳过`);
|
await TGLogger.Script(`[米游币任务]帖子${post.post.post_id}已点赞,跳过`);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
6
src/types/BBS/Post.d.ts
vendored
6
src/types/BBS/Post.d.ts
vendored
@@ -1,6 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* 帖子类型定义文件
|
* 帖子类型定义文件
|
||||||
* @since Beta v0.8.6
|
* @since Beta v0.9.8
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare namespace TGApp.BBS.Post {
|
declare namespace TGApp.BBS.Post {
|
||||||
@@ -124,7 +124,7 @@ declare namespace TGApp.BBS.Post {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 帖子数据
|
* 帖子数据
|
||||||
* @since Beta v0.7.2
|
* @since Beta v0.9.8
|
||||||
*/
|
*/
|
||||||
type FullData = {
|
type FullData = {
|
||||||
/** 帖子信息 */
|
/** 帖子信息 */
|
||||||
@@ -136,7 +136,7 @@ declare namespace TGApp.BBS.Post {
|
|||||||
/** 发帖人,可能为 null */
|
/** 发帖人,可能为 null */
|
||||||
user: User | null;
|
user: User | null;
|
||||||
/** 当前用户操作 */
|
/** 当前用户操作 */
|
||||||
self_operation: TGApp.BBS.User.SelfOperation;
|
self_operation: TGApp.BBS.User.SelfOperation | null;
|
||||||
/** 帖子统计,可能为 null */
|
/** 帖子统计,可能为 null */
|
||||||
stat: Stat | null;
|
stat: Stat | null;
|
||||||
/** 帮助系统,可能为 null */
|
/** 帮助系统,可能为 null */
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ onMounted(async () => {
|
|||||||
}
|
}
|
||||||
postData.value = resp;
|
postData.value = resp;
|
||||||
console.log(resp);
|
console.log(resp);
|
||||||
isLike.value = postData.value.self_operation.upvote_type !== 0;
|
isLike.value = (postData.value.self_operation?.upvote_type ?? 0) > 0;
|
||||||
await showLoading.update("正在渲染数据");
|
await showLoading.update("正在渲染数据");
|
||||||
renderPost.value = await getRenderPost(postData.value);
|
renderPost.value = await getRenderPost(postData.value);
|
||||||
await webviewWindow
|
await webviewWindow
|
||||||
|
|||||||
Reference in New Issue
Block a user