Ember code updates
This commit is contained in:
@@ -1,18 +1,15 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
import { action } from '@ember/object';
|
import { action } from '@ember/object';
|
||||||
import { alias } from '@ember/object/computed';
|
|
||||||
import { tracked } from '@glimmer/tracking';
|
import { tracked } from '@glimmer/tracking';
|
||||||
import config from 'kredits-web/config/environment';
|
import config from 'kredits-web/config/environment';
|
||||||
import { isAddress } from 'web3-utils';
|
import { isAddress } from 'web3-utils';
|
||||||
|
|
||||||
export default class BudgetController extends Controller {
|
export default class AccountController extends Controller {
|
||||||
@service kredits;
|
@service kredits;
|
||||||
|
|
||||||
@tracked accountAddress = null;
|
@tracked accountAddress = null;
|
||||||
|
|
||||||
@alias('kredits.githubAccessToken') githubAccessToken;
|
|
||||||
|
|
||||||
get isValidEthAccount () {
|
get isValidEthAccount () {
|
||||||
return isAddress(this.accountAddress);
|
return isAddress(this.accountAddress);
|
||||||
}
|
}
|
||||||
@@ -24,7 +21,7 @@ export default class BudgetController extends Controller {
|
|||||||
@action
|
@action
|
||||||
completeSignup () {
|
completeSignup () {
|
||||||
const payload = {
|
const payload = {
|
||||||
accessToken: this.githubAccessToken,
|
accessToken: this.kredits.githubAccessToken,
|
||||||
account: this.accountAddress
|
account: this.accountAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +40,7 @@ export default class BudgetController extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
console.log('[signup/account] Created contributor:', data);
|
console.log('[signup/account] Created contributor:', data);
|
||||||
|
|
||||||
this.githubAccessToken = null;
|
this.kredits.githubAccessToken = null;
|
||||||
this.accountAddress = null;
|
this.accountAddress = null;
|
||||||
|
|
||||||
this.transitionToRoute('signup.complete');
|
this.transitionToRoute('signup.complete');
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
import Controller from '@ember/controller';
|
import Controller from '@ember/controller';
|
||||||
|
import { action } from '@ember/object';
|
||||||
import config from 'kredits-web/config/environment';
|
import config from 'kredits-web/config/environment';
|
||||||
|
|
||||||
export default Controller.extend({
|
export default class IndexController extends Controller {
|
||||||
|
|
||||||
actions: {
|
|
||||||
|
|
||||||
connectGithub () {
|
|
||||||
window.location = config.githubConnectUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@action
|
||||||
|
connectGithub () {
|
||||||
|
window.location = config.githubConnectUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user