Skip to content

Conversation

@Bhuvaneshiva
Copy link

Pull Request Description

Fixed two issues preventing external apps from creating notifications:

  1. Module Loading

    • Changed script element type from 'text/javascript' to 'module' in useExternalApps.tsx
    • Allows proper loading of ES6 module-based external apps (remoteEntry.js)
    • Resolves "Cannot use import statement outside a module" error
  2. App Registry Integration

    • Added external apps from phoneState.extApps to useApps hook
    • Enables notification system to find external apps via getApp() function
    • Fixes "The app with id {appId} was not found" error
  3. Removed debug console.log for app background color

    • This was causing unwanted console output during notification rendering

Changes:

  • apps/phone/src/common/hooks/useExternalApps.tsx: Set script type to 'module'
  • apps/phone/src/os/apps/hooks/useApps.tsx: Include external apps in allApps array
  • apps/phone/src/os/new-notifications/components/NotificationBase.tsx: removed debug console log

This ensures external apps like npwd_qbx_garages can successfully create
notifications through the NPWD notification system.

Pull Request Checklist:

  • [Yes ] Have you followed the guidelines in our Contributing document and Code of Conduct?
  • [Yes ] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • [Yes ] Have you built and tested NPWD in-game after the relevant change?

- Set script type to 'module' for ES6 external app loading
- Include external apps in app registry for notification lookup

Resolves notification creation failures for external apps
- Removed console.log("app bg", app.backgroundColor) from NotificationBase component
- This was causing unwanted console output during notification rendering
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

Successfully merging this pull request may close these issues.

1 participant