Fixed slight bug in void system

This commit is contained in:
2022-09-14 11:47:06 +10:00
parent 5094bbaf2b
commit c146a7209d
2 changed files with 17 additions and 12 deletions

View File

@@ -17,11 +17,14 @@ module Program =
forward "/install" DredgePos.Installer.Router.router
}
let app = application {
use_mime_types [(".woff", "application/font-woff")]
use_static "wwwroot"
use_router router
url "http://0.0.0.0:5001"
}
let app =
let ipAddress = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList[2];
printf $"DredgePOS is now running at http://{ipAddress}:5001\n"
application {
use_mime_types [(".woff", "application/font-woff")]
use_static "wwwroot"
use_router router
url "http://0.0.0.0:5001"
}
run app

View File

@@ -123,7 +123,9 @@ const setItemQty = (orderItem: orderItem, qty: number) => {
const instructionIds = getInstructionItems(orderItem.id).map(orderItem => orderItem.id)
if(qty < 1){
const newItems = OrderScreen.order_items.filter(existingOrderItem => existingOrderItem.id != orderItem.id)
const newItems = OrderScreen.order_items.filter(existingOrderItem =>
(existingOrderItem.id != orderItem.id) && !instructionIds.includes(existingOrderItem.id)
)
OrderScreen.selected_item_ids = array_remove(OrderScreen.selected_item_ids, orderItem.id)
if(orderItem.item.item_type == "item") {
@@ -459,13 +461,13 @@ const scrollToElement = (JQueryElement: JQuery) => {
const element = JQueryElement.get()[0]
const container = JQueryElement.closest('.orderBox').get()[0]
const containerTop = $(container).scrollTop()
const containerBottom = containerTop + $(container).height();
const containerBottom = containerTop + $(container).height()
const elemTop = element.offsetTop
const elemBottom = elemTop + $(element).height();
const elemBottom = elemTop + $(element).height()
if (elemTop < containerTop) {
$(container).scrollTop(elemTop);
$(container).scrollTop(elemTop)
} else if (elemBottom > containerBottom) {
$(container).scrollTop(elemBottom - $(container).height());
$(container).scrollTop(elemBottom - $(container).height())
}
}