Skip to content

Commit 5b468a9

Browse files
authored
Merge pull request #112 from BinaryStudioAcademy/feature/fix_navigation_duplicated_errors_in_console
Handle NavigationDuplicated exception
2 parents 61afd03 + b706fbc commit 5b468a9

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

frontend/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
created() {
3838
EventEmitter.$on(TOKEN_EXPIRED_EVENT, () => {
3939
this.logout();
40-
this.$router.push({ name: 'auth.signIn' });
40+
this.$router.push({ name: 'auth.signIn' }).catch(() => {});
4141
});
4242
},
4343

frontend/src/components/common/Navbar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default {
135135
async onSignOut() {
136136
await this.signOut();
137137
138-
this.$router.push({ name: 'auth.signIn' });
138+
this.$router.push({ name: 'auth.signIn' }).catch(() => {});
139139
},
140140
141141
toggleMobileMenu() {

frontend/src/components/common/TweetPreviewList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
3939
methods: {
4040
onTweetClick(tweet) {
41-
this.$router.push({ name: 'tweet-page', params: { id: tweet.id } });
41+
this.$router.push({ name: 'tweet-page', params: { id: tweet.id } }).catch(() => {});
4242
},
4343
4444
infiniteHandler($state) {

frontend/src/components/view/tweet/TweetContainer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export default {
188188
189189
this.showSuccessMessage('Tweet deleted!');
190190
191-
this.$router.push({ name: 'feed' });
191+
this.$router.push({ name: 'feed' }).catch(() => {});
192192
} catch {
193193
this.showErrorMessage('Unable to delete tweet!');
194194
}

frontend/src/views/SignIn.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default {
7777
.then(() => {
7878
this.showSuccessMessage('Welcome!');
7979
80-
this.$router.push({ path: '/' });
80+
this.$router.push({ path: '/' }).catch(() => {});
8181
})
8282
.catch(error => this.showErrorMessage(error.message));
8383
},

frontend/src/views/SignUp.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default {
101101
.then(() => {
102102
this.showSuccessMessage('Welcome!');
103103
104-
this.$router.push({ path: '/' });
104+
this.$router.push({ path: '/' }).catch(() => {});
105105
})
106106
.catch(error => this.showErrorMessage(error.message));
107107
},

0 commit comments

Comments
 (0)