@@ -9,7 +9,8 @@ import type { AnyAddressType } from "@/core/types";
99
1010export const BOPIS_CODE = "BuyOnlinePickupInStore" ;
1111
12- const ADDRESSES_FETCH_LIMIT = 50 ;
12+ const ADDRESSES_FETCH_MAP_LIMIT = 50 ;
13+ const ADDRESSES_FETCH_LIST_LIMIT = 200 ;
1314
1415export function useBopis ( ) {
1516 const { t } = useI18n ( ) ;
@@ -33,6 +34,8 @@ export function useBopis() {
3334 : defineAsyncComponent ( ( ) => import ( "@/shared/checkout/components/select-address-modal.vue" ) ) ,
3435 ) ;
3536
37+ const fetchLimit = computed ( ( ) => ( isBopisMapEnabled . value ? ADDRESSES_FETCH_MAP_LIMIT : ADDRESSES_FETCH_LIST_LIMIT ) ) ;
38+
3639 const modalOpening = ref ( false ) ;
3740
3841 const normalizedAddresses = computed < AnyAddressType [ ] > ( ( ) =>
@@ -74,7 +77,7 @@ export function useBopis() {
7477 try {
7578 await fetchAddresses ( {
7679 cartId,
77- first : ADDRESSES_FETCH_LIMIT ,
80+ first : fetchLimit . value ,
7881 } ) ;
7982 } finally {
8083 modalOpening . value = false ;
@@ -111,7 +114,7 @@ export function useBopis() {
111114 onFilterChange : async ( ) => {
112115 await fetchAddresses ( {
113116 cartId,
114- first : ADDRESSES_FETCH_LIMIT ,
117+ first : fetchLimit . value ,
115118 keyword : filterKeyword . value ,
116119 filter : buildFilter ( ) ,
117120 } ) ;
0 commit comments