mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 08:45:20 +00:00
Merge pull request #139 from alpermelkeli/refactor/remove-static-context-field
refactor: remove context attribute at ChatViewModel.kt
This commit is contained in:
@@ -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 }
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user