package me.khodak.claudeusage

import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import me.khodak.claudeusage.data.PreferencesManager

class BootReceiver : BroadcastReceiver() {
    override fun onReceive(context: Context, intent: Intent) {
        if (intent.action != Intent.ACTION_BOOT_COMPLETED) return
        if (!PreferencesManager(context).isLoggedIn()) return
        UsageUpdateWorker.schedulePeriodicRefresh(context)
        UsageUpdateWorker.triggerImmediateRefresh(context)
    }
}
