Code Monkey home page Code Monkey logo

Comments (4)

werthdavid avatar werthdavid commented on August 10, 2024

Thanks for the research, will address this issue in the next release!

from ngx-scanner.

ntswor avatar ntswor commented on August 10, 2024

Thx for your fast response. I had a look at the commit and tested it locally. It's not solving the problem I mentioned.

The problem I'm referring to happens in the BrowserCodeReaderExt class. I will try to describe my use case a little bit in more detail:

  • I'm adding the component and starting the camera (by setting the start input to true)
  • As soon as I'm getting a response from the scan I'm stopping the camera (again by changing the start input to false - I even tried to call the stop method directly)
  • the camera is stopped correctly (BrowserCodeReaderExt stop() is called)
  • the stream is closed
  • but now the callbackFn of the BrowserCodeReaderExt decode function returns a value and the check is done if the scan should only be done once
  • if false (and it is false all the time) a new timeout is set and the decode is called again which leads to the mentioned error

A solution might be to not only check if the decode should be done once but also to check if the stream is still set:

if (!once && undefined !== this.stream) {
	setTimeout(function () { return _this.decodeWithDelay(callbackFn); }, this.timeBetweenScansMillis);
}

I have created a pull request (my first one on github) - so if you can have a look or give me feedback, I would appreciate it.

from ngx-scanner.

werthdavid avatar werthdavid commented on August 10, 2024

Thanks for the detailed analysis and the PR! Looks good to me, I merged it. Thanks! BTW: my first angular component and also my first active project on github as well 😉

from ngx-scanner.

lock avatar lock commented on August 10, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from ngx-scanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.