Onboarding / Deployment Scripts / Marketing updates
This commit is contained in:
@@ -249,11 +249,27 @@
|
||||
}
|
||||
}
|
||||
|
||||
function sortSelectedServices(services: string[]) {
|
||||
return [...services].sort((a, b) => {
|
||||
const indexA = booking.serviceOptions.indexOf(a);
|
||||
const indexB = booking.serviceOptions.indexOf(b);
|
||||
|
||||
if (indexA === -1 && indexB === -1) return a.localeCompare(b);
|
||||
if (indexA === -1) return 1;
|
||||
if (indexB === -1) return -1;
|
||||
|
||||
return indexA - indexB;
|
||||
});
|
||||
}
|
||||
|
||||
function toggleService(service: string, checked: boolean) {
|
||||
noteInteraction();
|
||||
|
||||
if (checked) {
|
||||
selectedServices = [service, ...selectedServices.filter((item) => item !== service)];
|
||||
selectedServices = sortSelectedServices([
|
||||
...selectedServices.filter((item) => item !== service),
|
||||
service
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user