Skip to content

Commit ce967f3

Browse files
committed
Promiseをasyncの書き方に修正
1 parent 3d3554b commit ce967f3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/pages/user/logout.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,13 @@ export default Vue.extend({
3131
methods: {
3232
async doLogout(): Promise<void> {
3333
this.loading = true
34-
await Auth.signOut()
35-
.then(() => {
36-
this.$router.push('/')
37-
})
38-
.catch(() => {
39-
this.loading = false
40-
this.error = true
41-
})
34+
try {
35+
await Auth.signOut()
36+
await this.$router.push('/')
37+
} catch {
38+
this.loading = false
39+
this.error = true
40+
}
4241
},
4342
},
4443
})

0 commit comments

Comments
 (0)