mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-30 13:56:58 -04:00
Allow response in webviewclosed event to optionally be URI encoded
This commit is contained in:
@@ -162,9 +162,10 @@ Clay.prototype.generateUrl = function() {
|
||||
Clay.prototype.getSettings = function(response, convert) {
|
||||
// Decode and parse config data as JSON
|
||||
var settings = {};
|
||||
response = response.match(/^\{/) ? response : decodeURIComponent(response);
|
||||
|
||||
try {
|
||||
settings = JSON.parse(decodeURIComponent(response));
|
||||
settings = JSON.parse(response);
|
||||
} catch (e) {
|
||||
throw new Error('The provided response was not valid JSON');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user