mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 11:33:34 +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);
|
_startGitClone(context);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
regenerateFunction: () {
|
||||||
|
setState(() {
|
||||||
|
publicKey = "";
|
||||||
|
});
|
||||||
|
_generateSshKey(context);
|
||||||
|
},
|
||||||
publicKey: publicKey,
|
publicKey: publicKey,
|
||||||
copyKeyFunction: _copyKeyToClipboard,
|
copyKeyFunction: _copyKeyToClipboard,
|
||||||
);
|
);
|
||||||
|
@ -91,11 +91,13 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
|||||||
|
|
||||||
class GitHostSetupSshKeyUnknownProvider extends StatelessWidget {
|
class GitHostSetupSshKeyUnknownProvider extends StatelessWidget {
|
||||||
final Func0<void> doneFunction;
|
final Func0<void> doneFunction;
|
||||||
|
final Func0<void> regenerateFunction;
|
||||||
final Func1<BuildContext, void> copyKeyFunction;
|
final Func1<BuildContext, void> copyKeyFunction;
|
||||||
final String publicKey;
|
final String publicKey;
|
||||||
|
|
||||||
GitHostSetupSshKeyUnknownProvider({
|
GitHostSetupSshKeyUnknownProvider({
|
||||||
@required this.doneFunction,
|
@required this.doneFunction,
|
||||||
|
@required this.regenerateFunction,
|
||||||
@required this.copyKeyFunction,
|
@required this.copyKeyFunction,
|
||||||
@required this.publicKey,
|
@required this.publicKey,
|
||||||
});
|
});
|
||||||
@ -124,10 +126,15 @@ class GitHostSetupSshKeyUnknownProvider extends StatelessWidget {
|
|||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
PublicKeyWidget(publicKey),
|
PublicKeyWidget(publicKey),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
|
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Copy Key",
|
text: "Copy Key",
|
||||||
onPressed: () => copyKeyFunction(context),
|
onPressed: () => copyKeyFunction(context),
|
||||||
),
|
),
|
||||||
|
GitHostSetupButton(
|
||||||
|
text: "Regenerate Key",
|
||||||
|
onPressed: regenerateFunction,
|
||||||
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
|
|
||||||
// Step 2
|
// Step 2
|
||||||
|
Reference in New Issue
Block a user