@@ -38,13 +38,13 @@ class ShockerScreen extends StatefulWidget {
3838 builder: (context) {
3939 TextEditingController codeController = TextEditingController ();
4040 return AlertDialog .adaptive (
41- title: Text ("Redeem share code" ),
41+ title: Text ("Claim invite or share code" ),
4242 content: SingleChildScrollView (
4343 child: Column (
4444 children: < Widget > [
4545 TextField (
4646 controller: codeController,
47- decoration: InputDecoration (labelText: "Share code" ),
47+ decoration: InputDecoration (labelText: "invite or share code" ),
4848 )
4949 ],
5050 ),
@@ -63,23 +63,24 @@ class ShockerScreen extends StatefulWidget {
6363 "Invalid code" , "The code cannot be empty" );
6464 return ;
6565 }
66- if (await redeemShareCode (code, context, manager)) {
66+ if (await redeemShareCodeOrInvite (code, context, manager)) {
6767 Navigator .of (context).pop ();
68+ InfoDialog .show ("Shares active" , "You can now control the shockers." );
6869
6970 await AlarmListManager .getInstance ().updateShockerStore ();
7071 reloadState ();
7172 }
7273 },
73- child: Text ("Redeem " ))
74+ child: Text ("Claim " ))
7475 ],
7576 );
7677 });
7778 }
7879
79- static Future <bool > redeemShareCode (
80+ static Future <bool > redeemShareCodeOrInvite (
8081 String code, BuildContext context, AlarmListManager manager) async {
81- LoadingDialog .show ("Redeeming code" );
82- String ? error = await manager.redeemShareCode (code);
82+ LoadingDialog .show ("Claiming code" );
83+ String ? error = await manager.redeemShareCodeOrInvite (code);
8384 if (error != null ) {
8485 Navigator .of (context).pop ();
8586 ErrorDialog .show ("Error" , error);
@@ -227,7 +228,7 @@ class ShockerScreen extends StatefulWidget {
227228 Navigator .of (context).pop ();
228229 startRedeemShareCode (manager, context, reloadState);
229230 },
230- child: Text ("Redeem share code " )),
231+ child: Text ("Claim invite " )),
231232 TextButton (
232233 onPressed: () async {
233234 await startPairShocker (manager, context, reloadState);
0 commit comments