mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 10:38:41 +00:00
fix #186
This commit is contained in:
parent
a520b471e8
commit
0485e306e1
1 changed files with 4 additions and 0 deletions
|
|
@ -34,10 +34,14 @@ class _EmojisState extends State<Emojis> {
|
|||
if (user.lastUsedEditorEmojis == null) {
|
||||
user.lastUsedEditorEmojis = [emoji];
|
||||
} else {
|
||||
if (user.lastUsedEditorEmojis!.contains(emoji)) {
|
||||
user.lastUsedEditorEmojis!.remove(emoji);
|
||||
}
|
||||
user.lastUsedEditorEmojis!.insert(0, emoji);
|
||||
if (user.lastUsedEditorEmojis!.length > 12) {
|
||||
user.lastUsedEditorEmojis = user.lastUsedEditorEmojis!.sublist(0, 12);
|
||||
}
|
||||
user.lastUsedEditorEmojis!.toSet().toList();
|
||||
}
|
||||
await updateUser(user);
|
||||
if (!context.mounted) return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue