fix & opt.

- fix: `sftpGoPath`
- opt.: `PersistentStore.toJson`
- rm: `first` store
- opt.: log print
This commit is contained in:
lollipopkit
2023-10-27 18:13:02 +08:00
parent 6579190ae4
commit 92bb653e81
14 changed files with 38 additions and 51 deletions

View File

@@ -44,13 +44,13 @@ class BackupPage extends StatelessWidget {
return ListView(
padding: const EdgeInsets.all(17),
children: [
if (isMacOS || isIOS) _buildIcloudSync(context),
_buildManual(context),
if (isMacOS || isIOS) _buildIcloud(context),
_buildFile(context),
],
);
}
Widget _buildManual(BuildContext context) {
Widget _buildFile(BuildContext context) {
return CardX(
ExpandTile(
title: Text(l10n.files),
@@ -75,7 +75,7 @@ class BackupPage extends StatelessWidget {
);
}
Widget _buildIcloudSync(BuildContext context) {
Widget _buildIcloud(BuildContext context) {
return CardX(
ExpandTile(
title: const Text('iCloud'),
@@ -109,8 +109,8 @@ class BackupPage extends StatelessWidget {
if (icloudLoading.value) {
return UIs.centerSizedLoadingSmall;
}
return SizedBox(
width: 120,
return ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 137),
child: Row(
children: [
TextButton(
@@ -153,7 +153,6 @@ class BackupPage extends StatelessWidget {
/// Issue #188
if (isWindows) {
await Shares.text(await File(path).readAsString());
} else {
await Shares.files([path]);
}
@@ -195,10 +194,10 @@ class BackupPage extends StatelessWidget {
),
TextButton(
onPressed: () async {
backup.restore();
await backup.restore();
Pros.reload();
context.pop();
RebuildNodes.app.rebuild();
Pros.reload();
},
child: Text(l10n.ok),
),

View File

@@ -247,12 +247,12 @@ class _ServerPageState extends State<ServerPage>
IconButton(
onPressed: () => _askFor(
func: () async {
if (Stores.first.showSuspendTip.fetch()) {
if (Stores.setting.showSuspendTip.fetch()) {
await context.showRoundDialog(
title: Text(l10n.attention),
child: Text(l10n.suspendTip),
);
Stores.first.showSuspendTip.put(false);
Stores.setting.showSuspendTip.put(false);
}
srv.client?.execWithPwd(
ShellFunc.suspend.exec,

View File

@@ -208,8 +208,10 @@ class _SftpPageState extends State<SftpPage> with AfterLayoutMixin {
if (!Stores.setting.recordHistory.fetch()) {
return [];
}
return Stores.history.sftpGoPath.all.where(
(element) => element.contains(val.text),
return List<String>.from(
Stores.history.sftpGoPath.all.where(
(element) => element.contains(val.text),
),
);
},
fieldViewBuilder: (_, controller, node, __) {