@@ -60,7 +60,7 @@ fun SettingsPage(goBack: () -> Boolean) {
60
60
val window = (LocalContext .current as MainActivity ).window
61
61
62
62
LaunchedEffect (githubState.siteConfigs) {
63
- if (prevSiteConfigs == null && githubState.siteConfigs != null ) {
63
+ if (prevSiteConfigs != githubState.siteConfigs) {
64
64
goBack()
65
65
}
66
66
}
@@ -108,17 +108,23 @@ fun SettingsPage(goBack: () -> Boolean) {
108
108
}
109
109
110
110
if (modalVisible)
111
- InputRemoteModal (setVisible = {
112
- modalVisible = it
113
- }) {
111
+ InputRemoteModal (
112
+ initialText = githubState.remoteUrl,
113
+ setVisible = {
114
+ modalVisible = it
115
+ }) {
114
116
Github .updateRemoteUrl(it)
115
117
}
116
118
}
117
119
}
118
120
119
121
@Composable
120
- fun InputRemoteModal (setVisible : (Boolean ) -> Unit , onSubmit : (url: String ) -> Unit ) {
121
- var text by remember { mutableStateOf(" " ) }
122
+ fun InputRemoteModal (
123
+ initialText : String = "",
124
+ setVisible : (Boolean ) -> Unit ,
125
+ onSubmit : (url: String ) -> Unit
126
+ ) {
127
+ var text by remember { mutableStateOf(initialText) }
122
128
val focusRequester = remember { FocusRequester () }
123
129
124
130
fun submit () {
@@ -162,6 +168,7 @@ fun InputRemoteModal(setVisible: (Boolean) -> Unit, onSubmit: (url: String) -> U
162
168
keyboardActions = KeyboardActions (
163
169
onSend = { submit() }
164
170
),
171
+ placeholder = { Text (" https://github.com/paulcoding810/h-viewer-scripts" ) }
165
172
)
166
173
Row (
167
174
modifier = Modifier .fillMaxWidth(),
0 commit comments