// Web preview only: Firebase messaging is native-only, so the switch just stores the choice.
import AsyncStorage from '@react-native-async-storage/async-storage';

const KEY = 'notifications:enabled';

export async function isEnabled(): Promise<boolean> {
  return (await AsyncStorage.getItem(KEY)) === '1';
}

export async function setEnabled(on: boolean): Promise<boolean> {
  await AsyncStorage.setItem(KEY, on ? '1' : '0');
  return on;
}
