Created
January 15, 2026 22:07
-
-
Save LethalMaus/bed6b48c9826191428a6bcca42c7800c to your computer and use it in GitHub Desktop.
syncUserProfile.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun syncUserProfile(profile: UserProfile) { | |
| scope.launch { | |
| val request = PutDataMapRequest.create(WearPaths.USER_PROFILE).apply { | |
| dataMap.putString(WearKeys.USERNAME, profile.username) | |
| }.asPutDataRequest().setUrgent() | |
| runCatching { dataClient.putDataItem(request).await() } | |
| .onSuccess { _userProfile.value = profile } | |
| .onFailure { throwable -> | |
| Log.e(TAG, "Failed to sync user profile", throwable) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment