Skip to content

Commit

Permalink
refactor: 📦 Update Available toasts no longer appear for non-admins
Browse files Browse the repository at this point in the history
  • Loading branch information
JamsRepos committed May 5, 2024
1 parent 0e36e02 commit 8f18d98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/wizarr-frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { defineComponent } from "vue";
import { mapWritableState, mapState, mapActions } from "pinia";
import { useThemeStore } from "@/stores/theme";
import { useServerStore } from "./stores/server";
import { useAuthStore } from "@/stores/auth";
import { useLanguageStore } from "@/stores/language";
import { useProgressStore } from "./stores/progress";
import { useGettext, type Language } from "vue3-gettext";
Expand Down Expand Up @@ -44,6 +45,7 @@ export default defineComponent({
...mapState(useThemeStore, ["theme"]),
...mapState(useLanguageStore, ["language"]),
...mapWritableState(useProgressStore, ["progress", "fullPageLoading"]),
...mapActions(useAuthStore, ["isAuthenticated"]),
},
methods: {
...mapActions(useThemeStore, ["updateTheme"]),
Expand Down Expand Up @@ -124,8 +126,8 @@ export default defineComponent({
if (serverData?.setup_required && this.$router.currentRoute.value.name !== "setup") this.$router.push("/setup");
if (!serverData?.setup_required && this.$router.currentRoute.value.name === "setup") this.$router.push("/");
// If update is available, open update message
if (serverData?.update_available) {
// If update is available, show update available toast to authenticated users
if (serverData?.update_available && this.isAuthenticated) {
this.$toast.info(UpdateAvailable, {
timeout: false,
draggable: false,
Expand Down

0 comments on commit 8f18d98

Please sign in to comment.