mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 01:02:14 +08:00
Remote Setup: Add a button to regenerate the key
This commit is contained in:
@ -177,6 +177,12 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
||||
_startGitClone(context);
|
||||
});
|
||||
},
|
||||
regenerateFunction: () {
|
||||
setState(() {
|
||||
publicKey = "";
|
||||
});
|
||||
_generateSshKey(context);
|
||||
},
|
||||
publicKey: publicKey,
|
||||
copyKeyFunction: _copyKeyToClipboard,
|
||||
openDeployKeyPage: _launchDeployKeyPage,
|
||||
|
@ -6,6 +6,7 @@ import 'githostsetup_loading.dart';
|
||||
|
||||
class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
||||
final Func0<void> doneFunction;
|
||||
final Func0<void> regenerateFunction;
|
||||
final Func1<BuildContext, void> copyKeyFunction;
|
||||
final String publicKey;
|
||||
|
||||
@ -13,6 +14,7 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
||||
|
||||
GitHostSetupSshKeyKnownProvider({
|
||||
@required this.doneFunction,
|
||||
@required this.regenerateFunction,
|
||||
@required this.copyKeyFunction,
|
||||
@required this.openDeployKeyPage,
|
||||
@required this.publicKey,
|
||||
@ -42,10 +44,15 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
||||
const SizedBox(height: 8.0),
|
||||
PublicKeyWidget(publicKey),
|
||||
const SizedBox(height: 8.0),
|
||||
|
||||
GitHostSetupButton(
|
||||
text: "Copy Key",
|
||||
onPressed: () => copyKeyFunction(context),
|
||||
),
|
||||
GitHostSetupButton(
|
||||
text: "Regenerate Key",
|
||||
onPressed: regenerateFunction,
|
||||
),
|
||||
const SizedBox(height: 16.0),
|
||||
|
||||
// Step 2
|
||||
|
Reference in New Issue
Block a user