background-playback-settings.js 323 B

12345678910111213
  1. import { STORAGE } from '@/core/constants/storage-keys'
  2. export function isBackgroundPlaybackEnabled() {
  3. try {
  4. return !!uni.getStorageSync(STORAGE.backgroundPlayback)
  5. } catch (_) {
  6. return false
  7. }
  8. }
  9. export function setBackgroundPlaybackEnabled(enabled) {
  10. uni.setStorageSync(STORAGE.backgroundPlayback, !!enabled)
  11. }