aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views/mods
diff options
context:
space:
mode:
authorRémy Raes <contact@remyraes.com>2023-04-10 14:25:32 +0200
committerGitHub <noreply@github.com>2023-04-10 14:25:32 +0200
commit6d58e6793d40df4fec518f37351868803a02a033 (patch)
tree8ba8b1fdf503579314e9475bee409e0ba549e7ad /src-vue/src/views/mods
parent0d4744ad1f05ea6410b4cbe4e1e0270e67055ce6 (diff)
downloadFlightCore-6d58e6793d40df4fec518f37351868803a02a033.tar.gz
FlightCore-6d58e6793d40df4fec518f37351868803a02a033.zip
refactor: Notifications (#259)
* feat: wrap ElNotification class in a showNotification method * refactor: replace notification invocations in mod views * feat: add 'info' type to showNotification method * refactor: replace notification invocations in repair view * refactor: replace notification invocations in settings view * refactor: replace notification invocations in developer view * feat: showNotification method now returns a NotificationHandle * feat: showNotification has a duration argument * refactor: replace notification invocations in pull requests module * refactor: replace notification invocation in repair view * refactor: replace notification invocations in UI store * refactor: remove unused import from play view * refactor: use showErrorNotification method to wrap up error display * fix: add missing showErrorNotification imports * style: format code * style: format ThunderstoreModCard.vue * style: format pull_requests.ts * style: format SettingsView.vue * style: format RepairView.vue * style: format DeveloperView.vue * refactor: remove useless import * refactor: add missing showErrorNotification invocation * feat: showErrorNotification has an optional title argument * style: format LocalModsView.vue
Diffstat (limited to 'src-vue/src/views/mods')
-rw-r--r--src-vue/src/views/mods/LocalModsView.vue22
1 files changed, 4 insertions, 18 deletions
diff --git a/src-vue/src/views/mods/LocalModsView.vue b/src-vue/src/views/mods/LocalModsView.vue
index 2cd253ae..3fb90bdc 100644
--- a/src-vue/src/views/mods/LocalModsView.vue
+++ b/src-vue/src/views/mods/LocalModsView.vue
@@ -35,10 +35,10 @@
<script lang="ts">
import { invoke } from '@tauri-apps/api';
-import { ElNotification } from 'element-plus';
import { defineComponent } from 'vue';
import { GameInstall } from '../../utils/GameInstall';
import { NorthstarMod } from "../../../../src-tauri/bindings/NorthstarMod";
+import { showErrorNotification, showNotification } from '../../utils/ui';
export default defineComponent({
name: 'LocalModsView',
@@ -85,12 +85,7 @@ export default defineComponent({
})
}
catch (error) {
- ElNotification({
- title: this.$t('generic.error'),
- message: `${error}`,
- type: 'error',
- position: 'bottom-right'
- });
+ showErrorNotification(`${error}`);
this.global_load_indicator = false;
return false;
}
@@ -106,19 +101,10 @@ export default defineComponent({
await invoke("delete_northstar_mod", { gameInstall: game_install, nsmodName: mod.name })
.then((message) => {
// Just a visual indicator that it worked
- ElNotification({
- title: this.$t('mods.local.success_deleting', {modName: mod.name}),
- type: 'success',
- position: 'bottom-right'
- });
+ showNotification(this.$t('mods.local.success_deleting', {modName: mod.name}));
})
.catch((error) => {
- ElNotification({
- title: this.$t('generic.error'),
- message: error,
- type: 'error',
- position: 'bottom-right'
- });
+ showErrorNotification(error);
})
.finally(() => {
this.$store.commit('loadInstalledMods');