Skip to content

Commit

Permalink
Merge pull request #208 from webduinoio/bug/8110
Browse files Browse the repository at this point in the history
Bug/8110
  • Loading branch information
shengyuan authored Aug 27, 2024
2 parents f08af1b + 3b553e8 commit 1024fa0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

## [1.12.2] - 2024.8.27

### Fixed

- 查詢後,無法再次查詢 [#8110](https://redmine.kingkit.codes/issues/8110)

## [1.12.1] - 2024.8.23

### Fixed

- 小助教查詢問題 [#8106](https://redmine.kingkit.codes/issues/8106)
Expand Down Expand Up @@ -237,7 +245,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- 問題回復處理 [#7029](https://redmine.kingkit.codes/issues/7029)
- 小書僮清單卡片樣式跑掉 [#6983](https://redmine.kingkit.codes/issues/6983)

[Unreleased]: https://github.com/webduinoio/pluto-frontend/compare/v1.12.0...HEAD
[Unreleased]: https://github.com/webduinoio/pluto-frontend/compare/v1.12.2...HEAD
[1.12.2]: https://github.com/webduinoio/pluto-frontend/compare/v1.12.1...v1.12.2
[1.12.1]: https://github.com/webduinoio/pluto-frontend/compare/v1.12.0...v1.12.1
[1.12.0]: https://github.com/webduinoio/pluto-frontend/compare/v1.11.2...v1.12.0
[1.11.2]: https://github.com/webduinoio/pluto-frontend/compare/v1.10.1...v1.11.2
[1.11.1]: https://github.com/webduinoio/pluto-frontend/compare/v1.10.1...v1.11.1
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-project",
"version": "1.12.0",
"version": "1.12.2",
"private": true,
"scripts": {
"dev": "vite --host --https --port 443",
Expand Down
16 changes: 13 additions & 3 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,17 @@ const loadActors = async () => {
lastIndex: get(dataLastIndex),
search: searchQuery.value,
});
// !這裡加上判斷式,是由於 onSearch 及 onLoad 會同時呼叫 loadActors
// 由於 onSearch 清除 data,當 data 變動時,onLoad 也會被觸發
if (value.list) {
data.value.push(...value.list);
// 使用 Set 來跟蹤已存在的 id
const existingIds = new Set(data.value.map((item: Actor) => item.id));
// 過濾掉重複的項目
const filteredList = value.list.filter((item: Actor) => !existingIds.has(item.id));
// 將過濾後的項目添加到 data 中
data.value.push(...filteredList);
set(dataLastIndex, value.lastIndex);
}
return value;
Expand All @@ -174,8 +183,9 @@ const onLoad = async ({ done }: { done: Function }) => {
};
const onSearch = async () => {
set(data, []);
data.value.splice(0, data.value.length);
set(dataLastIndex, '');
await loadActors();
};
</script>

Expand Down Expand Up @@ -284,4 +294,4 @@ const onSearch = async () => {
font-family: 'Poppins', sans-serif;
}
}
</style>
</style>

0 comments on commit 1024fa0

Please sign in to comment.