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

NRO does not exit cleanly #40

Closed
TooTallNate opened this issue Oct 5, 2023 · 3 comments
Closed

NRO does not exit cleanly #40

TooTallNate opened this issue Oct 5, 2023 · 3 comments

Comments

@TooTallNate
Copy link
Owner

The nro application prompts an error when pressing + to exit:

error

Originally posted by @hunshikan in #38 (comment)

@TooTallNate
Copy link
Owner Author

This has been in the back of my mind for a while now, but I'm having trouble figuring out how to properly diagnose the issue. Indeed it seems like nx.js apps do not exit cleanly when launched from the Albums menu.

As a workaround, I've been using a forwarder and launching the NRO from the home screen, which seems to prevent this issue.

@TooTallNate
Copy link
Owner Author

TooTallNate commented Oct 5, 2023

Another workaround is to just press the Home button instead of + to exit. This works even when the app is booted from the Albums menu.

If you would like to prevent the default behavior of the + button exiting the application, you can add this to your application's code:

import { Hid } from 'nxjs-constants';

Switch.addEventListener('buttondown', (event) => {
  if (event.detail & Hid.Button.Plus) {
    event.preventDefault();
  }
});

@TooTallNate
Copy link
Owner Author

I have fixed the top-level cause of this happening, which I consider an important enough fix to warrant another release, so v0.0.19 includes this fix!

There are still some cases where it is still happening, so if you encounter one of those situations, please open a new issue and include the code that can reproduce the issue.

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