Skip to content

Commit 8cf8583

Browse files
committed
changes
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 5d0f1ee commit 8cf8583

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

ui/src/components/header/ProjectMenu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</template>
3232

3333
<script>
34-
import InfiniteScrollSelect from '@/components/widgets/InfiniteScrollSelect.vue'
34+
import InfiniteScrollSelect from '@/components/widgets/InfiniteScrollSelect'
3535
3636
export default {
3737
name: 'ProjectMenu',

ui/src/components/widgets/InfiniteScrollSelect.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,12 @@ export default {
125125
this.totalCount = response.count || 0
126126
}
127127
const newOpts = response[this.resourceType] || []
128-
this.options = this.options.concat(newOpts)
128+
const existingIds = new Set(this.options.map(o => o.id))
129+
newOpts.forEach(opt => {
130+
if (!existingIds.has(opt.id)) {
131+
this.options.push(opt)
132+
}
133+
})
129134
this.page++
130135
131136
if (this.preselectedOptionId && this.successiveFetches < this.maxSuccessiveFetches) {

0 commit comments

Comments
 (0)