notification-settings.js 325 B

1234567891011
  1. /** @typedef {'pushs' | 'voice' | 'shock'} NoticePrefKey */
  2. /**
  3. * @param {import('vuex').Store} store
  4. * @param {NoticePrefKey} key
  5. * @param {boolean} value
  6. */
  7. export function persistNoticePref(store, key, value) {
  8. if (!store || typeof store.commit !== 'function') return
  9. store.commit('user/apply', { [key]: value })
  10. }