style: run ktlint on code
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
4a866bb40d
commit
ac5148e82c
|
|
@ -9,6 +9,7 @@ import chat.revolt.api.internals.Members
|
|||
import chat.revolt.api.realtime.DisconnectionState
|
||||
import chat.revolt.api.realtime.RealtimeSocket
|
||||
import chat.revolt.api.routes.user.fetchSelf
|
||||
import chat.revolt.api.schemas.Channel as ChannelSchema
|
||||
import chat.revolt.api.schemas.Emoji
|
||||
import chat.revolt.api.schemas.Message
|
||||
import chat.revolt.api.schemas.Server
|
||||
|
|
@ -38,7 +39,6 @@ import kotlinx.coroutines.withContext
|
|||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import chat.revolt.api.schemas.Channel as ChannelSchema
|
||||
|
||||
const val REVOLT_BASE = "https://api.revolt.chat"
|
||||
const val REVOLT_SUPPORT = "https://support.revolt.chat"
|
||||
|
|
|
|||
|
|
@ -41,10 +41,7 @@ suspend fun fetchSelf(): User {
|
|||
return user
|
||||
}
|
||||
|
||||
suspend fun patchSelf(
|
||||
status: Status? = null,
|
||||
pure: Boolean = false,
|
||||
) {
|
||||
suspend fun patchSelf(status: Status? = null, pure: Boolean = false) {
|
||||
val body = mutableMapOf<String, JsonElement>()
|
||||
if (status != null) {
|
||||
body["status"] = RevoltJson.encodeToJsonElement(Status.serializer(), status)
|
||||
|
|
@ -57,7 +54,8 @@ suspend fun patchSelf(
|
|||
MapSerializer(
|
||||
String.serializer(),
|
||||
JsonElement.serializer()
|
||||
), body
|
||||
),
|
||||
body
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable
|
|||
@Serializable
|
||||
data class Session(
|
||||
@SerialName("_id") val id: String,
|
||||
val name: String,
|
||||
val name: String
|
||||
) {
|
||||
fun isCurrent(): Boolean {
|
||||
return id == RevoltAPI.sessionId
|
||||
|
|
|
|||
|
|
@ -63,7 +63,6 @@ import chat.revolt.activities.RevoltTweenFloat
|
|||
import chat.revolt.activities.RevoltTweenInt
|
||||
import chat.revolt.api.schemas.ChannelType
|
||||
|
||||
|
||||
@Composable
|
||||
fun NativeMessageField(
|
||||
value: String,
|
||||
|
|
@ -112,7 +111,7 @@ fun NativeMessageField(
|
|||
Row(
|
||||
modifier = modifier
|
||||
.background(MaterialTheme.colorScheme.surfaceColorAtElevation(1.dp)),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
|
||||
|
|
|
|||
|
|
@ -104,9 +104,13 @@ fun StatusButton(
|
|||
.size(48.dp)
|
||||
.clickable { onClick(presence) }
|
||||
.then(
|
||||
if (selected) Modifier.background(
|
||||
if (selected) {
|
||||
Modifier.background(
|
||||
MaterialTheme.colorScheme.surfaceColorAtElevation(6.dp)
|
||||
) else Modifier
|
||||
)
|
||||
} else {
|
||||
Modifier
|
||||
}
|
||||
),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ import chat.revolt.persistence.KVStorage
|
|||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import io.ktor.client.request.get
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@HiltViewModel
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
|
|
|||
|
|
@ -112,9 +112,9 @@ import com.airbnb.lottie.compose.rememberLottieComposition
|
|||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import dagger.hilt.android.qualifiers.ApplicationContext
|
||||
import io.sentry.Sentry
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
|
||||
@HiltViewModel
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
|
|
|||
|
|
@ -91,10 +91,10 @@ import chat.revolt.sheets.ChannelInfoSheet
|
|||
import chat.revolt.sheets.MessageContextSheet
|
||||
import com.discord.simpleast.core.simple.SimpleMarkdownRules
|
||||
import com.discord.simpleast.core.simple.SimpleRenderer
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.launch
|
||||
import java.io.File
|
||||
import java.io.FileNotFoundException
|
||||
import kotlinx.coroutines.flow.distinctUntilChanged
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ import chat.revolt.components.generic.FormTextField
|
|||
import chat.revolt.components.generic.Weblink
|
||||
import chat.revolt.persistence.KVStorage
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@HiltViewModel
|
||||
class LoginViewModel @Inject constructor(
|
||||
|
|
|
|||
|
|
@ -48,8 +48,8 @@ import chat.revolt.components.generic.CollapsibleCard
|
|||
import chat.revolt.components.generic.FormTextField
|
||||
import chat.revolt.persistence.KVStorage
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.launch
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@HiltViewModel
|
||||
class MfaScreenViewModel @Inject constructor(
|
||||
|
|
|
|||
|
|
@ -204,7 +204,9 @@ fun SessionSettingsScreen(
|
|||
)
|
||||
|
||||
Text(
|
||||
text = stringResource(R.string.settings_sessions_log_out_other_description),
|
||||
text = stringResource(
|
||||
R.string.settings_sessions_log_out_other_description
|
||||
),
|
||||
style = MaterialTheme.typography.bodySmall.copy(
|
||||
fontWeight = FontWeight.Normal
|
||||
)
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ import chat.revolt.components.generic.SheetClickable
|
|||
import chat.revolt.components.screens.settings.SelfUserOverview
|
||||
import chat.revolt.persistence.KVStorage
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import javax.inject.Inject
|
||||
import kotlinx.coroutines.runBlocking
|
||||
|
||||
@HiltViewModel
|
||||
class SettingsScreenViewModel @Inject constructor(
|
||||
|
|
|
|||
Loading…
Reference in New Issue