Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StarPrnt should, but does not, accept null for some methods #4116

Closed
JCTInfinity opened this issue Mar 29, 2022 · 1 comment
Closed

StarPrnt should, but does not, accept null for some methods #4116

JCTInfinity opened this issue Mar 29, 2022 · 1 comment

Comments

@JCTInfinity
Copy link
Contributor

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://ionicworldwide.herokuapp.com/

Current behavior:
StarPrnt print methods and openCashDrawer have port argument typed to string. Attempting to pass a potentially null value throws a compile error in TypeScript environments.

Expected behavior:
These methods should (as noted in their comments) accept null values, which means: use the connected printer

Steps to reproduce:
Set up a typescript application and pass null or a null|string type variable for the port to openCashDrawer and/or any of the print methods. Compile the application and see a type error for the method about expecting a string.

Related code:
See related PR: #4095

Other information:
I've confirmed the change in the PR resolves the issue and correctly uses the connected printer when given a null port. Thanks for your attention and maintenance of this project.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):


Ionic:

   Ionic CLI       : 6.18.1 (/Users/jchristyler/.nvm/versions/node/v16.13.2/lib/node_modules/@ionic/cli)
   Ionic Framework : @ionic/vue 6.0.2

Capacitor:

   Capacitor CLI      : 3.3.4
   @capacitor/android : 3.3.4
   @capacitor/core    : 3.3.4
   @capacitor/ios     : 3.3.4

Utility:

   cordova-res : not installed globally
   native-run  : 1.5.0

System:

   NodeJS : v16.13.2 (/Users/jchristyler/.nvm/versions/node/v16.13.2/bin/node)
   npm    : 8.1.2
   OS     : macOS Monterey


  ─────────────────────────────────────────────────

     Ionic CLI update available: 6.18.1 → 6.19.0
          Run npm i -g @ionic/cli to update

  ─────────────────────────────────────────────────
@JCTInfinity
Copy link
Contributor Author

Fix is merged and updated with 5.41.0 (at least). Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant