add info message when leave group
This commit is contained in:
parent
974c75b9b6
commit
f9259d9d10
1 changed files with 9 additions and 2 deletions
|
@ -281,10 +281,17 @@ impl Component for ListGroups {
|
|||
true
|
||||
}
|
||||
MsgListGroups::FinishLeave(id) => {
|
||||
self.free_groups.push(self.groups.remove(id));
|
||||
let group = self.groups.remove(id);
|
||||
let name = group.name.clone();
|
||||
self.free_groups.push(group);
|
||||
if self.nb_show > 0 && id <= self.nb_show {
|
||||
self.nb_show -= 1;
|
||||
}
|
||||
|
||||
ctx.link().send_message(MsgListGroups::Info(
|
||||
String::from(&format!("Vous avez bien quitté le groupe {}", name)),
|
||||
String::new(),
|
||||
));
|
||||
true
|
||||
}
|
||||
MsgListGroups::SelectGroup(id) => {
|
||||
|
@ -322,7 +329,7 @@ impl Component for ListGroups {
|
|||
}
|
||||
false
|
||||
}
|
||||
MsgListGroups::Refresh => return true,
|
||||
MsgListGroups::Refresh => true,
|
||||
MsgListGroups::More => {
|
||||
self.nb_show += 3;
|
||||
if self.nb_show > self.groups.len() {
|
||||
|
|
Loading…
Reference in a new issue