mirror of
https://github.com/Moe-Sakura/frontend.git
synced 2026-03-15 04:53:18 +08:00
Fix filter structure in fetchVndbQuotes and enhance screenshot validation in VndbPanel.vue
- Updated the filter format in fetchVndbQuotes to directly use vnId for improved clarity. - Added a check in VndbPanel.vue to ensure the current game ID matches before processing screenshots, preventing unnecessary updates.
This commit is contained in:
@@ -598,7 +598,7 @@ export async function fetchVndbQuotes(vnId: string): Promise<VndbQuote[]> {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
filters: ['vn', '=', ['id', '=', vnId]],
|
||||
filters: ['vn', '=', vnId],
|
||||
fields: 'id, quote, character{id, name, original}',
|
||||
results: 10,
|
||||
}),
|
||||
|
||||
@@ -730,8 +730,13 @@ watch(() => searchStore.vndbInfo, async (newInfo) => {
|
||||
|
||||
// 检查缓存的截图是否已加载
|
||||
if (newInfo?.screenshots && newInfo.screenshots.length > 0) {
|
||||
const vnIdForScreenshots = newInfo.id
|
||||
nextTick(() => {
|
||||
requestAnimationFrame(() => {
|
||||
// 检查是否仍是同一个游戏
|
||||
if (currentVnId.value !== vnIdForScreenshots) {
|
||||
return
|
||||
}
|
||||
const screenshotImgs = modalRef.value?.querySelectorAll('img[alt*="截图"]')
|
||||
if (screenshotImgs) {
|
||||
for (let i = 0; i < screenshotImgs.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user