show login dialog when clicking note if not logged in (#13856)

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2025-12-21 22:18:18 +08:00
committed by GitHub
parent 84eb75d5b6
commit 1f9689dc00
6 changed files with 58 additions and 35 deletions

View File

@@ -776,6 +776,8 @@ class _DesktopHomePageState extends State<DesktopHomePage>
}
if (call.method == kWindowMainWindowOnTop) {
windowOnTop(null);
} else if (call.method == kWindowRefreshCurrentUser) {
gFFI.userModel.refreshCurrentUser();
} else if (call.method == kWindowGetWindowInfo) {
final screen = (await window_size.getWindowInfo()).screen;
if (screen == null) {

View File

@@ -561,19 +561,21 @@ class _GeneralState extends State<_General> {
children.add(_OptionCheckBox(
context, 'Allow linux headless', kOptionAllowLinuxHeadless));
}
children.add(_OptionCheckBox(
context,
'note-at-conn-end-tip',
kOptionAllowAskForNoteAtEndOfConnection,
isServer: false,
optSetter: (key, value) async {
if (value && !gFFI.userModel.isLogin) {
final res = await loginDialog();
if (res != true) return;
}
await mainSetLocalBoolOption(key, value);
},
));
if (!bind.isDisableAccount()) {
children.add(_OptionCheckBox(
context,
'note-at-conn-end-tip',
kOptionAllowAskForNoteAtEndOfConnection,
isServer: false,
optSetter: (key, value) async {
if (value && !gFFI.userModel.isLogin) {
final res = await loginDialog();
if (res != true) return;
}
await mainSetLocalBoolOption(key, value);
},
));
}
return _Card(title: 'Other', children: children);
}