Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix join discord button #927

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/stepper-signup.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<JoinSteps::StatusCard
@status={{this.applicationStatus}}
@feedback={{this.applicationFeedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{this.joinDiscordAction}}
/>
{{/if}}
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/components/stepper-signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class StepperSignupComponent extends Component {
}
}

@action async joinDiscordHandler() {
@action async joinDiscordAction() {
const inviteLink = await this.onboarding.discordInvite();
if (inviteLink) {
window.open(`https://${inviteLink}`, '_blank');
Expand Down
2 changes: 1 addition & 1 deletion app/components/stepper.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<JoinSteps::StatusCard
@status={{this.applicationStatus}}
@feedback={{this.applicationFeedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{@joinDiscord}}
MehulKChaudhari marked this conversation as resolved.
Show resolved Hide resolved
/>
{{/if}}

Expand Down
7 changes: 0 additions & 7 deletions app/components/stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,4 @@ export default class StepperComponent extends Component {
);
}
}

@action async joinDiscordHandler() {
const inviteLink = await this.onboarding.discordInvite();
if (inviteLink) {
window.open(`https://${inviteLink}`, '_blank');
}
}
}
7 changes: 7 additions & 0 deletions app/controllers/join.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,11 @@ export default class JoinController extends Controller {
this.isLoading = false;
}
}

@action async joinDiscordAction() {
const inviteLink = await this.onboarding.discordInvite();
if (inviteLink) {
window.open(`https://${inviteLink}`, '_blank');
}
}
}
5 changes: 3 additions & 2 deletions app/templates/join.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<JoinSteps::StatusCard
@status={{this.applicationData.status}}
@feedback={{this.applicationData.feedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{this.joinDiscordAction}}
/>
{{else}}
{{#if this.isDevMode}}
Expand All @@ -46,7 +46,8 @@
@handleGenerateChaincode={{this.handleGenerateChaincode}}
/>
{{else}}
<Stepper />
<Stepper
@joinDiscord={{this.joinDiscordAction}} />
{{/if}}
{{/if}}
{{/if}}
Expand Down
12 changes: 6 additions & 6 deletions tests/integration/components/status-card-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module('Integration | Component | status-card', function (hooks) {
setupRenderingTest(hooks);

hooks.beforeEach(function () {
this.set('joinDiscordHandler', () => {
this.set('joinDiscordAction', () => {
window.open = this.spy();
});
this.set('ANKUSH_TWITTER', ANKUSH_TWITTER);
Expand All @@ -34,7 +34,7 @@ module('Integration | Component | status-card', function (hooks) {
<JoinSteps::StatusCard
@status={{this.status}}
@feedback={{this.feedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{this.joinDiscordAction}}
/>
`);

Expand Down Expand Up @@ -63,7 +63,7 @@ module('Integration | Component | status-card', function (hooks) {
<JoinSteps::StatusCard
@status={{this.status}}
@feedback={{this.feedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{this.joinDiscordAction}}
/>
`);

Expand Down Expand Up @@ -91,7 +91,7 @@ module('Integration | Component | status-card', function (hooks) {
<JoinSteps::StatusCard
@status={{this.status}}
@feedback={{this.feedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{this.joinDiscordAction}}
/>
`);

Expand All @@ -116,7 +116,7 @@ module('Integration | Component | status-card', function (hooks) {
<JoinSteps::StatusCard
@status={{this.status}}
@feedback={{this.feedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{this.joinDiscordAction}}
/>
`);

Expand All @@ -138,7 +138,7 @@ module('Integration | Component | status-card', function (hooks) {
<JoinSteps::StatusCard
@status={{this.status}}
@feedback={{this.feedback}}
@joinDiscord={{this.joinDiscordHandler}}
@joinDiscord={{this.joinDiscordAction}}
/>
`);

Expand Down
Loading