ripe-tech / ripe-sdk

The public Javascript SDK for RIPE Core
https://www.platforme.com
Apache License 2.0
8 stars 4 forks source link

fix: support initialsExtra with one group in _queryToSpec #238

Closed BeeMargarida closed 3 years ago

BeeMargarida commented 3 years ago
- -
Issue Originated from https://github.com/ripe-tech/ripe-twitch-ui/pull/71
Dependencies --
Decisions The twitch ui uses only initialsExtra to save the initials state. This caused problems when using an URL with only one group in the initials extra field.
The _parseExtraS function does not support extraS to be a string. However this can happen if the initials_extra in the URL comes with only one group, and the _unpackQuery function returns the initials_extra as string instead of an array.
This caused errors in the parsing, where instead of returning a correct initialsExtra object, it returned an object parsed by each letter.

Based on the previous PR (https://github.com/ripe-tech/ripe-sdk/pull/237#issuecomment-770874298), the solution was moved to _queryToSpec, similar to the tuples approach.
Animated GIF image
joamag commented 3 years ago

@BeeMargarida good fix 👍