aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views/SettingsView.vue
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/SettingsView.vue
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/SettingsView.vue')
-rw-r--r--src-vue/src/views/SettingsView.vue20
1 files changed, 7 insertions, 13 deletions
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index e526f821..772a4c5c 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -72,10 +72,10 @@
<script lang="ts">
import { defineComponent } from "vue";
-import { ElNotification } from 'element-plus';
import { invoke } from "@tauri-apps/api";
import { ReleaseCanal } from "../utils/ReleaseCanal";
import { Store } from 'tauri-plugin-store-api';
+import { showErrorNotification, showNotification } from "../utils/ui";
import LanguageSelector from "../components/LanguageSelector.vue";
const persistentStore = new Store('flight-core-settings.json');
@@ -125,12 +125,11 @@ export default defineComponent({
this.developerModeClicks += 1;
if (this.developerModeClicks >= 6 && !this.$store.state.developer_mode) {
this.$store.commit('toggleDeveloperMode');
- ElNotification({
- title: this.$t('settings.dev_mode_enabled_title'),
- message: this.$t('settings.dev_mode_enabled_text'),
- type: 'info',
- position: 'bottom-right'
- });
+ showNotification(
+ this.$t('settings.dev_mode_enabled_title'),
+ this.$t('settings.dev_mode_enabled_text'),
+ 'info'
+ );
this.developerModeClicks = 0;
}
},
@@ -141,12 +140,7 @@ export default defineComponent({
await invoke("open_repair_window")
.then((message) => { })
.catch((error) => {
- ElNotification({
- title: 'Error',
- message: error,
- type: 'error',
- position: 'bottom-right'
- });
+ showErrorNotification(error);
});
},
},