Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 调整搜索方案默认搜索逻辑, 可在 通用配置-搜索 中调整 #1561

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

IITII
Copy link
Member

@IITII IITII commented Sep 5, 2023

fix: 调整搜索方案默认搜索逻辑, 可在 通用配置-搜索 中调整

#257
#1508

截图

image image

@IITII IITII merged commit 922b2d5 into pt-plugins:dev Sep 5, 2023
1 check passed
@Meng-Lan
Copy link

Meng-Lan commented Sep 6, 2023

按我的理解,这只是不执行doSearch的逻辑,会saveConfig。
但是针对相同key,changeSearchSolution之后,应该还是无法手动触发搜索,除非换个key。因为就算是走了route,由于页面之前存在过,watch里面的oldKey和newKey是相等的,那个if就会过滤掉

@IITII
Copy link
Member Author

IITII commented Sep 6, 2023

按我的理解,这只是不执行doSearch的逻辑,会saveConfig。 但是针对相同key,changeSearchSolution之后,应该还是无法手动触发搜索,除非换个key。因为就算是走了route,由于页面之前存在过,watch里面的oldKey和newKey是相等的,那个if就会过滤掉

  • 搜索框是一个 route.push 的逻辑, 相同的 key 会报错. 不相同的 key 才会正常跳转. 跳转后 data 里面的 value 从 undefined 变成了 keyword, 触发了搜索. 也就是说 "针对相同key,changeSearchSolution之后,应该还是无法手动触发搜索" 这个的原因是报错了....
  • 手动切换搜索方案之后, 从主观感觉上就应该保存修改后的保存方案. 而不是等手动触发搜索. 比如搜索关键词, 你可以删除. 但是在搜索页切换搜索方案的时候还是会按之前的关键词进行搜索. 因为这是两个值, 搜索的时候用的是 lastSearchKey

你可以自己把 if 去掉, 把日志加上, 本地先试试

@Meng-Lan
Copy link

Meng-Lan commented Sep 7, 2023

对,所有我想说的是,切换了搜索方案之后,不改关键词应该是没法执行搜索,这是个bug。

Comment on lines +406 to +409
if (key === this.searchKey && this.$router.currentRoute.name === targetRoute.name) {
console.log(`skip same searchTorrent: key: ${key}, searchKey: ${this.searchKey}`)
return;
}
Copy link
Member Author

@IITII IITII Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里判了 route name, 你可以在这里通过自己加 event 触发搜索. 目前过滤掉就好了 @Meng-Lan
反正直接刷新网页, 刷新后会搜索

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants