Skip to content

Commit

Permalink
refactor(GithubAppSelector): requiresReAuth to computed
Browse files Browse the repository at this point in the history
  • Loading branch information
BreadGenie committed Jul 31, 2024
1 parent 971bb0f commit c1bd418
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions dashboard/src2/components/GitHubAppSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export default {
return {
app: {},
selectedBranch: '',
requiresReAuth: false,
selectedGithubUser: null,
selectedGithubRepository: null
};
Expand Down Expand Up @@ -146,12 +145,7 @@ export default {
options() {
return {
url: 'press.api.github.options',
auto: true,
onError(error) {
if (error.messages.includes('Bad credentials')) {
this.requiresReAuth = true;
}
}
auto: true
};
},
branches() {
Expand Down Expand Up @@ -192,6 +186,11 @@ export default {
this.$resources.options.data.installations.length === 0)
);
},
requiresReAuth() {
return this.$resources.options?.error?.messages.includes(
'Bad credentials'
);
},
state() {
let location = window.location.href;
let state = { team: this.$team.name, url: location };
Expand Down

0 comments on commit c1bd418

Please sign in to comment.