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

Fixed reading shortcuts from twa manifest #328

Merged
merged 3 commits into from
Sep 8, 2020

Conversation

andreban
Copy link
Member

@andreban andreban commented Sep 8, 2020

update was crashing with method not found: assetName. Loading
the JSON from the file doesn't automatically assign methods to
the shortcut. So, we create proper shortcuts when creating the
TwaManifest from the JSON.

`update` was crashing with method not found: `assetName`. Loading
the JSON from the file doesn't automatically assign methods to
the shortcut. So, we create proper shortcuts when creating the
TwaManifest from the JSON.
- data.shortcuts can be undefined.
- Expect a ShortchutInfo[] on constructor.
@@ -153,7 +153,10 @@ export class TwaManifest {
this.signingKey = data.signingKey;
this.appVersionName = data.appVersion;
this.appVersionCode = data.appVersionCode || DEFAULT_APP_VERSION_CODE;
this.shortcuts = data.shortcuts;
this.shortcuts = (data.shortcuts || []).map((si) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Huh, this line is quite neat.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks.

@andreban andreban merged commit 4719c09 into GoogleChromeLabs:master Sep 8, 2020
@andreban andreban added the bug Something isn't working label Sep 8, 2020
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