Add an error component
Shows when a rendering error has been triggered, like the one in 5edc402a01
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -20,7 +20,9 @@
|
||||
</p>
|
||||
</b-message>
|
||||
</div>
|
||||
<main>
|
||||
<error v-if="error" :error="error" />
|
||||
|
||||
<main v-else>
|
||||
<transition name="fade" mode="out-in">
|
||||
<router-view />
|
||||
</transition>
|
||||
@@ -57,6 +59,8 @@ import { ICurrentUser } from "./types/current-user.model";
|
||||
components: {
|
||||
Logo,
|
||||
NavBar,
|
||||
error: () =>
|
||||
import(/* webpackChunkName: "editor" */ "./components/Error.vue"),
|
||||
"mobilizon-footer": Footer,
|
||||
},
|
||||
})
|
||||
@@ -65,12 +69,18 @@ export default class App extends Vue {
|
||||
|
||||
currentUser!: ICurrentUser;
|
||||
|
||||
error: Error | null = null;
|
||||
|
||||
async created(): Promise<void> {
|
||||
if (await this.initializeCurrentUser()) {
|
||||
await initializeCurrentActor(this.$apollo.provider.defaultClient);
|
||||
}
|
||||
}
|
||||
|
||||
errorCaptured(error: Error): void {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
private async initializeCurrentUser() {
|
||||
const userId = localStorage.getItem(AUTH_USER_ID);
|
||||
const userEmail = localStorage.getItem(AUTH_USER_EMAIL);
|
||||
|
||||
Reference in New Issue
Block a user