mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-20 03:24:50 +00:00
Duplicate client id dialog and filtering, scrollable code block for dialogs
This commit is contained in:
parent
e8007082a7
commit
de5a4aa5f3
2 changed files with 13 additions and 1 deletions
|
@ -6,6 +6,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.text.method.ScrollingMovementMethod
|
||||
import android.util.TypedValue
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
|
@ -223,6 +224,7 @@ class UIDialogs {
|
|||
this.visibility = View.GONE;
|
||||
else {
|
||||
this.text = code;
|
||||
this.movementMethod = ScrollingMovementMethod.getInstance();
|
||||
this.visibility = View.VISIBLE;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -209,7 +209,17 @@ class StatePlatform {
|
|||
}
|
||||
|
||||
if(_availableClients.distinctBy { it.id }.count() < _availableClients.size) {
|
||||
throw IllegalStateException("Attempted to add 2 clients with the same ID");
|
||||
val dups = _availableClients.filter { x-> _availableClients.count { it.id == x.id } > 1 };
|
||||
val overrideClients = _availableClients.distinctBy { it.id }
|
||||
_availableClients.clear();
|
||||
_availableClients.addAll(overrideClients);
|
||||
|
||||
StateApp.instance.scopeOrNull?.launch(Dispatchers.Main) {
|
||||
UIDialogs.showDialog(context, R.drawable.ic_error_pred, "Duplicate plugin ids detected", "This can cause unexpected behavior, ideally uninstall duplicate plugins (ids)",
|
||||
dups.map { it.name }.joinToString("\n"), 0, UIDialogs.Action("Ok", { }));
|
||||
}
|
||||
|
||||
//throw IllegalStateException("Attempted to add 2 clients with the same ID");
|
||||
}
|
||||
|
||||
enabled = _enabledClientsPersistent.getAllValues()
|
||||
|
|
Loading…
Add table
Reference in a new issue