notification-prefs.js 353 B

1234567891011121314
  1. export function readNotificationPrefs(store) {
  2. const defaults = { pushs: true, voice: true, shock: true }
  3. try {
  4. const user = store?.state?.user
  5. if (!user || typeof user !== 'object') return defaults
  6. return {
  7. pushs: user.pushs !== false,
  8. voice: user.voice !== false,
  9. shock: user.shock !== false
  10. }
  11. } catch (_) {
  12. return defaults
  13. }
  14. }