diff --git a/app/src/main/java/com/bitchat/android/ui/ChatViewModel.kt b/app/src/main/java/com/bitchat/android/ui/ChatViewModel.kt index 190f696d..d8fc1634 100644 --- a/app/src/main/java/com/bitchat/android/ui/ChatViewModel.kt +++ b/app/src/main/java/com/bitchat/android/ui/ChatViewModel.kt @@ -24,14 +24,12 @@ class ChatViewModel( application: Application, val meshService: BluetoothMeshService ) : AndroidViewModel(application), BluetoothMeshDelegate { - - private val context: Context = application.applicationContext - + // State management private val state = ChatState() // Specialized managers - private val dataManager = DataManager(context) + private val dataManager = DataManager(application.applicationContext) private val messageManager = MessageManager(state) private val channelManager = ChannelManager(state, messageManager, dataManager, viewModelScope) val privateChatManager = PrivateChatManager(state, messageManager, dataManager) @@ -46,7 +44,7 @@ class ChatViewModel( privateChatManager = privateChatManager, notificationManager = notificationManager, coroutineScope = viewModelScope, - onHapticFeedback = { ChatViewModelUtils.triggerHapticFeedback(context) }, + onHapticFeedback = { ChatViewModelUtils.triggerHapticFeedback(application.applicationContext) }, getMyPeerID = { meshService.myPeerID } )