package com.remax.visualnovel.app.viewmodel

import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope
import com.remax.visualnovel.manager.login.LoginManager
import com.remax.visualnovel.repository.api.MessageRepository
import com.remax.visualnovel.repository.api.UserRepository

import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject

/**
 * Created by HJW on 2022/11/1
 */
@HiltViewModel
class AppGlobalViewModel @Inject constructor(
    application: Application,
    private val userRepository: UserRepository,
    private val messageRepository: MessageRepository
) : AndroidViewModel(application) {



    /**
     * 更新firebase设备码到后端，推送用
     */
    fun updateTerminal(terminalCode: String?) {
        if (LoginManager.isLogin) {
            viewModelScope.launch {
//                userRepository.updateTerminal(terminalCode)
            }
        }
    }

}