fix notification not show profile

This commit is contained in:
Kr328 committed 2020-04-01 00:52:36 +08:00
1 parent 27cd92b4b1
commit 05d8dae4e0
2 files changed
+4 -1

No files matched your search

@@ -143,6 +143,9 @@ class ClashCore(private val service: Service) : CoroutineScope by MainScope() {
notification.setProfile(active.name)
if (!settings.get(ServiceSettings.NOTIFICATION_REFRESH))
notification.updateBase()
broadcastProfileLoaded(service)
} catch (e: Exception) {
stopSelf(e.message ?: "Unknown")
@@ -66,7 +66,7 @@ class ClashNotification(
context.startForeground(CLASH_STATUS_NOTIFICATION_ID, notification)
}
private fun updateBase() {
fun updateBase() {
val notification = baseBuilder
.setContentTitle(currentProfile)
.setContentText(context.getText(R.string.running))