Skip to content

Commit aa2d314

Browse files
committed
Fix notif preset
1 parent e320666 commit aa2d314

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/src/main/java/com/cornellappdev/coursegrab/LoginActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,16 @@ class LoginActivity : AppCompatActivity() {
271271
sendRegistrationToServer(token)
272272
}
273273

274-
enableNotificationsStatus()
274+
setNotificationsStatus(preferencesHelper.mobileAlertSetting)
275275

276276
val intent = Intent(this@LoginActivity, MainActivity::class.java)
277277
startActivity(intent)
278278
}
279279

280-
private fun enableNotificationsStatus() {
280+
private fun setNotificationsStatus(enabled: Boolean) {
281281
val setNotifs = Endpoint.setNotification(
282282
accessToken = preferencesHelper.sessionToken.toString(),
283-
notifSetting = "ANDROID"
283+
notifSetting = if (enabled) "ANDROID" else "NONE"
284284
)
285285

286286
lifecycleScope.launch {

0 commit comments

Comments
 (0)