Merge pull request #724 from Safelite/bug/brydon/SSR-1292
Refactoring hasAnyNonWindshieldPart getter
This commit is contained in:
commit
596fc64841
1 changed files with 5 additions and 1 deletions
|
|
@ -281,7 +281,11 @@ export const useMainStore = defineStore({
|
||||||
return !damage.isRepair
|
return !damage.isRepair
|
||||||
&& (lineItems.glassParts?.some((gp) => gp.partType === partTypeStrings.WINDSHIELD) ?? false);
|
&& (lineItems.glassParts?.some((gp) => gp.partType === partTypeStrings.WINDSHIELD) ?? false);
|
||||||
},
|
},
|
||||||
hasAnyNonWindshieldGlassParts: (s) => !s.order.policy.isDamageGlassOnly,
|
hasAnyNonWindshieldGlassParts: (s) => {
|
||||||
|
const { damage } = s.order;
|
||||||
|
const nonWindshieldItems = damage.glassToReplace?.filter((glass) => glass.glassLocation !== damageLocationsSelected.WINDSHIELD);
|
||||||
|
return !!nonWindshieldItems?.length;
|
||||||
|
},
|
||||||
isMobileAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|
isMobileAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE
|
||||||
|| state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP,
|
|| state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP,
|
||||||
isDropOffAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.DROP_OFF,
|
isDropOffAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.DROP_OFF,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue