bump gomuks, use new pause/resume commands
This commit is contained in:
parent
f971c50df0
commit
a2638d5c82
2 changed files with 11 additions and 4 deletions
|
|
@ -200,6 +200,9 @@ class ClientController extends AsyncNotifier<int> {
|
|||
Future<String?> setState(SetStateRequest request) async =>
|
||||
await _sendCommand("set_state", request.toJson());
|
||||
|
||||
Future<void> pauseSync() => _sendCommand("pause_sync");
|
||||
Future<void> resumeSync() => _sendCommand("resume_sync");
|
||||
|
||||
Future<void> verify(String recoveryKey) =>
|
||||
_sendCommand("verify", {"recovery_key": recoveryKey});
|
||||
|
||||
|
|
|
|||
|
|
@ -156,11 +156,12 @@ class GomuksListenerController extends AsyncNotifier<void> {
|
|||
// Mobile OSes block network access for backgrounded apps, so pause
|
||||
// syncing instead of letting it fail.
|
||||
ref.listen(AppPausedController.provider, (_, paused) {
|
||||
final client = ref.read(ClientController.provider.notifier);
|
||||
if (paused) {
|
||||
GomuksPauseSync(handle);
|
||||
client.pauseSync().onError(showError);
|
||||
} else {
|
||||
ref.invalidate(TypingController.provider);
|
||||
GomuksResumeSync(handle);
|
||||
client.resumeSync().onError(showError);
|
||||
}
|
||||
}, fireImmediately: true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue