-
- {{ formatType(pref.type) }}
+
+
+
{{ formatType(pref.type) }}
+
togglePref(pref, val)"
+ />
@@ -550,6 +548,7 @@ import {
updateNotificationPreference,
} from '~/utils/notification'
import TimeManager from '~/utils/time'
+import BaseSwitch from '~/components/BaseSwitch.vue'
const config = useRuntimeConfig()
const API_BASE_URL = config.public.apiBaseUrl
@@ -582,10 +581,10 @@ const fetchPrefs = async () => {
notificationPrefs.value = await fetchNotificationPreferences()
}
-const togglePref = async (pref) => {
- const ok = await updateNotificationPreference(pref.type, !pref.enabled)
+const togglePref = async (pref, value) => {
+ const ok = await updateNotificationPreference(pref.type, value)
if (ok) {
- pref.enabled = !pref.enabled
+ pref.enabled = value
await fetchNotifications({
page: page.value,
size: pageSize,
@@ -846,26 +845,21 @@ onActivated(async () => {
padding: 20px;
}
-.message-control-push-item-container {
+.message-control-item-container {
display: flex;
- flex-direction: row;
- flex-wrap: wrap;
+ flex-direction: column;
gap: 10px;
}
-.message-control-push-item {
- font-size: 14px;
- margin-bottom: 5px;
- padding: 8px 16px;
- border: 1px solid var(--normal-border-color);
- border-radius: 10px;
- cursor: pointer;
- transition: all 0.3s ease;
+.message-control-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ max-width: 200px;
}
-.message-control-push-item.select {
- background-color: var(--primary-color);
- color: white;
+.message-control-item-label {
+ font-size: 14px;
}
@media (max-width: 768px) {
diff --git a/frontend_nuxt/pages/settings.vue b/frontend_nuxt/pages/settings.vue
index 7178ee347..cc2028e38 100644
--- a/frontend_nuxt/pages/settings.vue
+++ b/frontend_nuxt/pages/settings.vue
@@ -38,10 +38,7 @@