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

Update TwaManifest.ts shortcut comment #766

Merged
merged 2 commits into from
Mar 9, 2023
Merged

Update TwaManifest.ts shortcut comment #766

merged 2 commits into from
Mar 9, 2023

Conversation

hslee2008
Copy link
Contributor

@hslee2008 hslee2008 commented Feb 27, 2023

Describe the issue
The shortcuts attribute is not working and the comments on how to do this is also wrong.

 * shortcuts: [
 *      // Insert shortcuts here, for example:
- *      // [name: 'Open SVG', short_name: 'Open', url: '/open', icon: 'splash']
+ *      // { name: 'Open SVG', shortName: 'Open', url: '/open', chosenIconUrl: 'https://example.com/example.svg' }
 *  ],
  1. The comment above should actually be an object rather than an array.
  2. There should be chosenIconUrl according to the cli.
  3. It should be shortName not short_name as it creates errors.
C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\util.js:299
    return input.replace(/[\\']/g, '\\\\\\$&');
                 ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at Object.escapeGradleString (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\util.js:299:18)
    at ShortcutInfo.toString (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\ShortcutInfo.js:49:35)
    at C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\TwaManifest.js:205:67
    at Array.map (<anonymous>)
    at Object.generateShortcuts (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\TwaManifest.js:205:37)
    at eval (lodash.templateSources[0]:34:11)
    at TwaGenerator.applyTemplate (C:\Users\USER\AppData\Roaming\npm\node_modules\@bubblewrap\cli\node_modules\@bubblewrap\core\dist\lib\TwaGenerator.js:179:55)

Node.js v18.13.0

Copy link
Member

@andreban andreban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this and sending over a PR. LGTM.

@andreban andreban merged commit efc7251 into GoogleChromeLabs:main Mar 9, 2023
@andreban andreban added the bug Something isn't working label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants