Fix connectionById (and others) not refreshing when repo became available

merge-requests/67/merge
Hank Grabowski 2024-12-19 11:49:40 -05:00
rodzic 9a6cbbb9f0
commit 262a178696
3 zmienionych plików z 12 dodań i 9 usunięć

2
.gitignore vendored
Wyświetl plik

@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/
# IntelliJ related

Wyświetl plik

@ -39,9 +39,10 @@ class _ConnectionsRepoSync extends _$ConnectionsRepoSync {
@override
Result<IConnectionsRepo, bool> build(Profile profile) {
_crsLogger.info('Build $profile');
ref
.watch(_connectionsRepoProvider(profile).future)
.then((repo) => state = Result.ok(repo));
ref.watch(_connectionsRepoProvider(profile).future).then((repo) {
state = Result.ok(repo);
ref.notifyListeners();
});
return Result.error(true);
}
}
@ -88,7 +89,7 @@ Result<Connection, ExecError> connectionById(
{bool forceUpdate = false}) {
_cbiLogger.finest('Build for $id for $profile');
final result = ref
.read(_connectionsRepoSyncProvider(profile))
.watch(_connectionsRepoSyncProvider(profile))
.andThen((repo) => repo.getById(id))
.transform((c) {
if (c.status == ConnectionStatus.unknown && forceUpdate) {
@ -117,7 +118,7 @@ Result<Connection, ExecError> connectionByHandle(
Ref ref, Profile profile, String handle) {
_cbhLogger.finest('Build for $handle for $profile');
return ref
.read(_connectionsRepoSyncProvider(profile))
.watch(_connectionsRepoSyncProvider(profile))
.andThen((repo) => repo.getByHandle(handle))
.execErrorCast();
}

Wyświetl plik

@ -641,10 +641,10 @@ packages:
dependency: "direct main"
description:
name: http_parser
sha256: "76d306a1c3afb33fe82e2bbacad62a61f409b5634c915fceb0d799de1a913360"
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
url: "https://pub.dev"
source: hosted
version: "4.1.1"
version: "4.0.2"
image:
dependency: "direct main"
description:
@ -1321,10 +1321,10 @@ packages:
dependency: transitive
description:
name: shelf
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
url: "https://pub.dev"
source: hosted
version: "1.4.2"
version: "1.4.1"
shelf_web_socket:
dependency: transitive
description: