diff --git a/controller/Session.class.php b/controller/Session.class.php index ee1e9e50..fdb944d2 100644 --- a/controller/Session.class.php +++ b/controller/Session.class.php @@ -6,6 +6,7 @@ class Session KEY_DOWNLOAD_ALLOWED = 'beta_download_allowed2', KEY_PREFINERY_USER_ID = 'prefinery_user_id', KEY_PREFINER_USED_CUSTOM_CODE = 'prefinery_used_custom_code', + KEY_DEVELOPER_LAST_FORM = 'developer_last_form', KEY_DEVELOPER_CREDITS_ERROR = 'developer_credits_error', KEY_DEVELOPER_CREDITS_WALLET_ADDRESS = 'developer_credits_wallet_address', KEY_DEVELOPER_RETURN_URL_SUCCESS = 'developer_return_url_success', diff --git a/controller/action/DeveloperActions.class.php b/controller/action/DeveloperActions.class.php index 5a2dfea4..446d5ce3 100644 --- a/controller/action/DeveloperActions.class.php +++ b/controller/action/DeveloperActions.class.php @@ -3,22 +3,22 @@ class DeveloperActions extends Actions { const DEVELOPER_REWARD = 250, - API_DOC_URL = 'https://lbryio.github.io/lbry/api/'; + API_DOC_URL = 'https://lbryio.github.io/lbry/api/'; public static function executeQuickstart(string $step = null) { - $stepLabels = [ - '' => 'Home', + $stepLabels = [ + '' => 'Home', 'install' => 'Installation', - 'api' => 'The API', + 'api' => 'The API', 'credits' => 'Credits' ]; - $allSteps = array_keys($stepLabels); + $allSteps = array_keys($stepLabels); $currentStep = $step ?: $allSteps[0]; $viewParams = [ 'currentStep' => $currentStep, - 'stepLabels' => $stepLabels + 'stepLabels' => $stepLabels ]; if ($currentStep !== 'all') @@ -49,12 +49,10 @@ class DeveloperActions extends Actions public static function prepareFormNewDeveloperRewardPartial(array $vars) { - $sendToGithub = !Session::get(Session::KEY_GITHUB_ACCESS_TOKEN); return $vars + [ 'defaultWalletAddress' => Session::get(Session::KEY_DEVELOPER_CREDITS_WALLET_ADDRESS), - 'error' => Session::getFlash(Session::KEY_DEVELOPER_CREDITS_ERROR), - 'sendToGithub' => $sendToGithub, - 'apiUrl' => LBRY::getApiUrl('/user/new_github') + 'error' => Session::get(Session::KEY_DEVELOPER_LAST_FORM) == "new_developer" ? Session::getFlash(Session::KEY_DEVELOPER_CREDITS_ERROR) : '', + 'apiUrl' => LBRY::getApiUrl('/user/new_github') ]; } @@ -62,13 +60,15 @@ class DeveloperActions extends Actions { return $vars + [ 'defaultWalletAddress' => Session::get(Session::KEY_DEVELOPER_CREDITS_WALLET_ADDRESS), - 'error' => Session::getFlash(Session::KEY_DEVELOPER_CREDITS_ERROR), + 'error' => Session::get(Session::KEY_DEVELOPER_LAST_FORM) == "new_publish" ? Session::getFlash(Session::KEY_DEVELOPER_CREDITS_ERROR) : '', + 'apiUrl' => LBRY::getApiUrl('/reward/new') ]; } public static function executeQuickstartAuth() { Session::set(Session::KEY_DEVELOPER_CREDITS_WALLET_ADDRESS, trim(Request::getPostParam('wallet_address'))); + Session::set(Session::KEY_DEVELOPER_LAST_FORM, Request::getPostParam('formName')); if (Request::getPostParam('returnUrl')) { @@ -92,7 +92,7 @@ class DeveloperActions extends Actions public static function executeQuickstartGithubCallback() { - $code = Request::getParam('code'); + $code = Request::getParam('code'); if (!$code) { diff --git a/view/template/developer/_formCreditsPublish.php b/view/template/developer/_formCreditsPublish.php index 4ec14101..017f58a7 100644 --- a/view/template/developer/_formCreditsPublish.php +++ b/view/template/developer/_formCreditsPublish.php @@ -1,25 +1,28 @@ -