mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 19:17:58 +00:00
plugin_framework, fix dup ui widgets
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -23,7 +23,16 @@ class PluginModel with ChangeNotifier {
|
||||
final Map<String, String> opts = {};
|
||||
|
||||
void add(UiType ui) {
|
||||
uiList.add(ui);
|
||||
bool found = false;
|
||||
for (int i = 0; i < uiList.length; i++) {
|
||||
if (uiList[i].key == ui.key) {
|
||||
uiList[i] = ui;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
uiList.add(ui);
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user