File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
vector/src/main/java/im/vector/app/features/settings Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ import org.matrix.android.sdk.api.session.integrationmanager.IntegrationManagerC
71
71
import org.matrix.android.sdk.api.session.integrationmanager.IntegrationManagerService
72
72
import org.matrix.android.sdk.flow.flow
73
73
import org.matrix.android.sdk.flow.unwrap
74
+ import timber.log.Timber
74
75
import java.io.File
75
76
import java.net.URL
76
77
import java.util.UUID
@@ -265,7 +266,17 @@ class VectorSettingsGeneralFragment :
265
266
// Disable it while updating the state, will be re-enabled by the account data listener.
266
267
it.isEnabled = false
267
268
lifecycleScope.launch {
268
- session.integrationManagerService().setIntegrationEnabled(newValue as Boolean )
269
+ try {
270
+ session.integrationManagerService().setIntegrationEnabled(newValue as Boolean )
271
+ } catch (failure: Throwable ) {
272
+ Timber .e(failure, " Failed to update integration manager state" )
273
+ activity?.let { activity ->
274
+ Toast .makeText(activity, errorFormatter.toHumanReadable(failure), Toast .LENGTH_SHORT ).show()
275
+ }
276
+ // Restore the previous state
277
+ it.isChecked = ! it.isChecked
278
+ it.isEnabled = true
279
+ }
269
280
}
270
281
true
271
282
}
You can’t perform that action at this time.
0 commit comments