diff --git a/frontend/package.json b/frontend/package.json index 4cdb311..45ac994 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,6 +20,7 @@ "moment": "^2.29.3", "vue": "^3.2.13", "vue-router": "^4.0.15", + "vue-toast-notification": "^3.0", "vuex": "^4.0.2" }, "devDependencies": { diff --git a/frontend/src/components/Login.vue b/frontend/src/components/Login.vue index 3c23bc0..66300be 100644 --- a/frontend/src/components/Login.vue +++ b/frontend/src/components/Login.vue @@ -77,7 +77,7 @@ export default { this.$router.replace({ name: 'Dashboard' }); }) .catch((err) => { - this.error = err.message; + this.$root.$toast.error(err.message); console.log(err); }); }, diff --git a/frontend/src/main.js b/frontend/src/main.js index 9c5488f..1a74e60 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -7,6 +7,8 @@ import store from './store'; import router from './routes/index'; import './index.css'; import { getAuth } from './auth'; +import VueToast from 'vue-toast-notification'; +import 'vue-toast-notification/dist/theme-default.css'; const firebaseConfig = { apiKey: 'AIzaSyDzBNz_bMRHUTxdrhc4LCf4UMzTIyyRB5s', @@ -30,4 +32,5 @@ getAuth().onAuthStateChanged((user) => { const app = createApp(App); app.use(store); app.use(router); +app.use(VueToast); app.mount('#app'); diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 1edbcde..f19c94d 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -8790,6 +8790,11 @@ vue-template-es2015-compiler@^1.9.0: resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.9.1.tgz#1ee3bc9a16ecbf5118be334bb15f9c46f82f5825" integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw== +vue-toast-notification@^3.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/vue-toast-notification/-/vue-toast-notification-3.0.4.tgz#dfd6ff37daa99be18f13c3e56dc0074fe3f3cdbe" + integrity sha512-rEhLtcKg8SVdBpdN7PrNst5nmY8dw0j3NkNImqurhlGurqR/QDKoou0t2PuCReEOCTKqHvfLCle2I3kwQWDWDQ== + vue@^3.2.13: version "3.2.36" resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.36.tgz#8daa996e2ced521708de97d066c7c998e8bc3378"