@@ -212,7 +212,10 @@ private fun CompanionScreen(
212212 Box (modifier = Modifier .padding(padding).fillMaxSize()) {
213213 when {
214214 state.loading && state.books.isEmpty() -> CenteredProgress ()
215- state.noWatch -> CenteredText (stringResource(R .string.no_watch))
215+ state.noWatch -> ReconnectPrompt (
216+ text = stringResource(R .string.no_watch),
217+ onReconnect = vm::refresh,
218+ )
216219 state.books.isEmpty() && state.folders.isEmpty() ->
217220 CenteredText (stringResource(R .string.empty_library))
218221 else -> BoundedBookList (
@@ -992,6 +995,24 @@ private fun CenteredText(text: String) {
992995 ) { Text (text) }
993996}
994997
998+ @Composable
999+ private fun ReconnectPrompt (text : String , onReconnect : () -> Unit ) {
1000+ Box (
1001+ modifier = Modifier .fillMaxSize().padding(24 .dp),
1002+ contentAlignment = Alignment .Center ,
1003+ ) {
1004+ Column (
1005+ horizontalAlignment = Alignment .CenterHorizontally ,
1006+ verticalArrangement = Arrangement .spacedBy(16 .dp),
1007+ ) {
1008+ Text (text, textAlign = androidx.compose.ui.text.style.TextAlign .Center )
1009+ Button (onClick = onReconnect) {
1010+ Text (stringResource(R .string.reconnect))
1011+ }
1012+ }
1013+ }
1014+ }
1015+
9951016/* * MIME types that SAF should offer. Matches the parsers in `:app`, plus
9961017 * application/pdf for the experimental PDF→HTML converter (handled in this
9971018 * utility app only; the watch never receives a raw PDF). */
0 commit comments