mirror of
https://github.com/AppFlowy-IO/AppFlowy
synced 2026-05-24 09:38:25 +00:00
fix: prevent grid header from creating identical options
This commit is contained in:
parent
1ab0a8351e
commit
a6130a27c2
2 changed files with 10 additions and 2 deletions
|
|
@ -51,7 +51,11 @@ class MultiSelectAction with ISelectOptionAction {
|
|||
(option) {
|
||||
typeOption.freeze();
|
||||
typeOption = typeOption.rebuild((typeOption) {
|
||||
typeOption.options.insert(0, option);
|
||||
final exists = typeOption.options
|
||||
.any((element) => element.name == option.name);
|
||||
if (!exists) {
|
||||
typeOption.options.insert(0, option);
|
||||
}
|
||||
});
|
||||
|
||||
return typeOption.options;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,11 @@ class SingleSelectAction with ISelectOptionAction {
|
|||
(option) {
|
||||
typeOption.freeze();
|
||||
typeOption = typeOption.rebuild((typeOption) {
|
||||
typeOption.options.insert(0, option);
|
||||
final exists = typeOption.options
|
||||
.any((element) => element.name == option.name);
|
||||
if (!exists) {
|
||||
typeOption.options.insert(0, option);
|
||||
}
|
||||
});
|
||||
|
||||
return typeOption.options;
|
||||
|
|
|
|||
Loading…
Reference in a new issue