Updated submodule added class to error message

This commit is contained in:
ポール ウェッブ 2019-04-25 16:00:12 -05:00
parent ef28a931f9
commit ebdd3433d1
3 changed files with 21 additions and 11 deletions

View file

@ -15,18 +15,19 @@ class LBRY
public static function getLBCtoUSDRate() public static function getLBCtoUSDRate()
{ {
$response = CurlWithCache::get(static::getApiUrl('/lbc/exchange_rate'), [], [ $response = CurlWithCache::get(static::getApiUrl('/lbc/exchange_rate'), [], [
'cache' => 3600, //one hour 'cache' => 3600, //one hour
'json_response' => true 'json_response' => true
]); ]);
return $response['data']['lbc_usd'] ?? 0; return $response['data']['lbc_usd'] ?? 0;
} }
public static function subscribe($email, $tag = null) public static function subscribe($email, $tag = null)
{ {
return Curl::post(static::getApiUrl('/list/subscribe'), array_filter([ return Curl::post(static::getApiUrl('/list/subscribe'), array_filter([
'email' => $email, 'email' => $email,
'tag' => $tag, 'tag' => $tag,
]), ['json_response' => true]); ]), ['json_response' => true]);
} }
public static function editEmailSettings($token, $email, $isPrimary =null, $isEnabled = null) public static function editEmailSettings($token, $email, $isPrimary =null, $isEnabled = null)
@ -86,9 +87,18 @@ class LBRY
public static function editYouTube($status_token, $channel_name, $email, $sync_consent) public static function editYouTube($status_token, $channel_name, $email, $sync_consent)
{ {
if ($email == null) { if ($email == null) {
return Curl::post(static::getApiUrl("/yt/update"), ['status_token' => $status_token, 'new_preferred_channel' => $channel_name, 'sync_consent' => $sync_consent], ['json_response' => true]); return Curl::post(static::getApiUrl("/yt/update"), [
'new_preferred_channel' => $channel_name,
'status_token' => $status_token,
'sync_consent' => $sync_consent
], ['json_response' => true]);
} else { } else {
return Curl::post(static::getApiUrl("/yt/update"), ['status_token' => $status_token, 'new_email' => $email, 'new_preferred_channel' => $channel_name, 'sync_consent' => $sync_consent], ['json_response' => true]); return Curl::post(static::getApiUrl("/yt/update"), [
'new_email' => $email,
'new_preferred_channel' => $channel_name,
'status_token' => $status_token,
'sync_consent' => $sync_consent
], ['json_response' => true]);
} }
} }

View file

@ -66,7 +66,7 @@
</div> </div>
<table> <table>
<thead style="font-size: 80%;"> <thead>
<tr> <tr>
<th>Your Sync Status</th> <th>Your Sync Status</th>
<th>Subscribers</th> <th>Subscribers</th>
@ -133,7 +133,7 @@
<input type="hidden" name="status_token" id="status_token" value="<?php echo $token ?>"/> <input type="hidden" name="status_token" id="status_token" value="<?php echo $token ?>"/>
</div> </div>
<?php if ($error_message): echo "<div>" . "The following error occurred: " . $error_message . " For support please send an email to hello@lbry.com" . "</div>"; endif; ?> <?php if ($error_message): echo "<p class='error-block'>" . "The following error occurred: <strong>" . $error_message . "</strong> For support please send an email to hello@lbry.com" . "</p>"; endif; ?>
<fieldset> <fieldset>
<legend>Confirm your preferences</legend> <legend>Confirm your preferences</legend>

@ -1 +1 @@
Subproject commit a587adc14942a9e1c90a84cfec99449086236c9e Subproject commit cf350bb24b8f5e48f887e7253cc4f3f127462d65