mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
HostSetup: Allow keys to be regenerated even with a custom setup
This commit is contained in:
@ -180,6 +180,12 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
||||
_startGitClone(context);
|
||||
});
|
||||
},
|
||||
regenerateFunction: () {
|
||||
setState(() {
|
||||
publicKey = "";
|
||||
});
|
||||
_generateSshKey(context);
|
||||
},
|
||||
publicKey: publicKey,
|
||||
copyKeyFunction: _copyKeyToClipboard,
|
||||
);
|
||||
|
@ -91,11 +91,13 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
||||
|
||||
class GitHostSetupSshKeyUnknownProvider extends StatelessWidget {
|
||||
final Func0<void> doneFunction;
|
||||
final Func0<void> regenerateFunction;
|
||||
final Func1<BuildContext, void> copyKeyFunction;
|
||||
final String publicKey;
|
||||
|
||||
GitHostSetupSshKeyUnknownProvider({
|
||||
@required this.doneFunction,
|
||||
@required this.regenerateFunction,
|
||||
@required this.copyKeyFunction,
|
||||
@required this.publicKey,
|
||||
});
|
||||
@ -124,10 +126,15 @@ class GitHostSetupSshKeyUnknownProvider 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