Skip to content

Commit

Permalink
fix: Show VirtualPrinter by default when not prod
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-Fabi committed Jul 21, 2024
1 parent 9d59a7c commit aa7baec
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.datepollsystems.waiterrobot.mediator.printer.service

import org.datepollsystems.waiterrobot.mediator.App
import org.datepollsystems.waiterrobot.mediator.app.Config
import org.datepollsystems.waiterrobot.mediator.printer.AbstractLocalPrinter
import org.datepollsystems.waiterrobot.mediator.printer.LocalPrinter
import org.datepollsystems.waiterrobot.mediator.printer.LocalPrinterInfo
Expand All @@ -20,6 +22,13 @@ object PrinterDiscoverService {
_localPrinterMap = PrintServiceLookup
.lookupPrintServices(DocFlavor.SERVICE_FORMATTED.PAGEABLE, null)
.map { LocalPrinter(it) }
.let {
if (App.config !is Config.Prod) {
it.plus(VirtualLocalPrinter)
} else {
it
}
}
.associateBy { it.localId }
}

Expand Down

0 comments on commit aa7baec

Please sign in to comment.