summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-03-23 20:49:06 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-03-23 20:49:06 +0100
commit8a04db5cdb1fad22ddc0764cb60b2e5a9822a417 (patch)
tree86c34992c60512c0dff2636004eda3fb0d3c4e85 /src
parent4bc0c4b4d51281b6dde2f77e33fd6c93dba83d03 (diff)
fix: commit not found message
Diffstat (limited to 'src')
-rw-r--r--src/views/Commit.vue25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/views/Commit.vue b/src/views/Commit.vue
index d8b0050..234fc88 100644
--- a/src/views/Commit.vue
+++ b/src/views/Commit.vue
@@ -4,11 +4,13 @@
b-container(v-if="loading")
b-overlay(:show="true" spinner-large)
b-container(v-else)
+ .commi(v-if="error404")
+ h2 Commit not found
commit-card(
:data="commit"
:author="author_avatar"
:committer="committer_avatar"
- :expand="true"
+ :expand="true" v-else
)
</template>
@@ -23,16 +25,25 @@ export default {
'header-blue': HeaderBlue,
'commit-card': Commit,
},
+ data() {
+ return {
+ error404: false
+ }
+ },
async mounted() {
this.$store.dispatch('set_loading', true);
await this.$store.dispatch('get_commit', this.hash);
- await this.$store.dispatch('get_email',
- {type: 'author', email: this.commit.author_email});
- if(this.commit.author_email != this.commit.committer_email) {
- await this.$store.dispatch('get_email',
- {type: 'committer', email: this.commit.committer_email});
+ if(this.commit.detail) {
+ this.error404 = true;
} else {
- await this.$store.dispatch('set_committer', this.author_avatar)
+ await this.$store.dispatch('get_email',
+ {type: 'author', email: this.commit.author_email});
+ if(this.commit.author_email != this.commit.committer_email) {
+ await this.$store.dispatch('get_email',
+ {type: 'committer', email: this.commit.committer_email});
+ } else {
+ await this.$store.dispatch('set_committer', this.author_avatar)
+ }
}
this.$store.dispatch('set_loading', false);
},