chore: Display attribution for sticker packs
This commit is contained in:
parent
089932a9f4
commit
87ca3c1f1f
3 changed files with 53 additions and 4 deletions
|
|
@ -47,12 +47,24 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
|||
room = widget.roomId != null
|
||||
? Matrix.of(context).client.getRoomById(widget.roomId!)
|
||||
: null;
|
||||
stateKey = packKeys?.firstOrNull;
|
||||
setStateKey(packKeys?.firstOrNull, reset: false);
|
||||
}
|
||||
|
||||
void setStateKey(String key) {
|
||||
void setStateKey(String? key, {reset = true}) {
|
||||
stateKey = key;
|
||||
resetAction();
|
||||
|
||||
final event = key == null
|
||||
? null
|
||||
: room?.getState(
|
||||
'im.ponies.room_emotes',
|
||||
key,
|
||||
);
|
||||
final eventPack = event?.content.tryGetMap<String, Object?>('pack');
|
||||
packDisplayNameController.text =
|
||||
eventPack?.tryGet<String>('display_name') ?? '';
|
||||
packAttributionController.text =
|
||||
eventPack?.tryGet<String>('attribution') ?? '';
|
||||
if (reset) resetAction();
|
||||
}
|
||||
|
||||
bool showSave = false;
|
||||
|
|
@ -139,6 +151,12 @@ class EmotesSettingsController extends State<EmotesSettings> {
|
|||
setState(() {});
|
||||
}
|
||||
|
||||
final TextEditingController packDisplayNameController =
|
||||
TextEditingController();
|
||||
|
||||
final TextEditingController packAttributionController =
|
||||
TextEditingController();
|
||||
|
||||
void removeImageAction(String oldImageCode) => setState(() {
|
||||
pack!.images.remove(oldImageCode);
|
||||
showSave = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue