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

Patient name shows "undefined" for a time being during back and forth from Prescription page #2945

Closed
ArpitaSussol opened this issue Jun 12, 2020 · 5 comments
Assignees

Comments

@ArpitaSussol
Copy link

Describe the bug

Patient name shows "undefined" during back and forth from Dispense page

To reproduce

Steps to reproduce the behavior:

  1. Go to Dispensary -> Patients tab
  2. Click on Dispense action
  3. From Prescription page, click on back.
  4. See error.
    https://recordit.co/ywG2rmPLZI

Expected behaviour

Patient name should not be shown as "Undefined Undefined" even for a second for better user experience.

Proposed Solution

Leave if you don't know how to fix/implement. Edit this issue description and explain here if you know the best path of implementing the fix within the codebase.

Version and device info

  • App version: v5.0.3

Additional context

arises while testing tablet feature for PR https://github.com/sussol/msupply/pull/6236

@ArpitaSussol ArpitaSussol changed the title Patient name shows "undefined" for a time being during back and forth from Dispense page Patient name shows "undefined" for a time being during back and forth from Prescription page Jun 12, 2020
@wlthomson
Copy link
Contributor

Look's like a navigation issue.

@joshxg knows more about this than me but from what I can see, it looks like the cleanup function in goBack (src/navigation/actions.js) is nullifying the transaction before the back animation is completed. Not sure whether this is a re-render that needs to be avoided, or if there's another way around this.

If the prescription is deleted (which I think it has to be), the transaction has to be cleared, or an illegal access error will be thrown.

Tried so far:

  • Removing the batch around the navigateBack and cleanUp dispatches.
  • Moving the cleanup logic to the PrescriptionReducer.

Neither solved the problem, so any ideas appreciated!

@josh-griffin
Copy link
Contributor

@wlthomson I haven't looked in depth (I can if you want me to though) - but is there a selector for the name? Just `name ?? "" maybe?

def an annoyance through a combo of realm + deleting requirement! I suspect the prescriber name is the same? If not, can just use whatever thats doing? Same thing with the title in the top left I think?

@wlthomson wlthomson self-assigned this Jul 6, 2020
@wlthomson
Copy link
Contributor

@joshxg Made a quick fix by tweaking a couple of prescription selectors.. Not necessarily the ideal solution, but solves the problem from the user's perspective!

wlthomson added a commit that referenced this issue Jul 15, 2020
…-name-on-back

#2945 fix undefined patient name on back
@wlthomson
Copy link
Contributor

Fixed by #3012.

@ArpitaSussol
Copy link
Author

ArpitaSussol commented Aug 3, 2020

Tested in V6.0.0 rc3

Testing

  • When navigating back from the first page of a prescription, the patient name does not display as undefined. - PASSED

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

3 participants