Skip to content

Commit

Permalink
Merge pull request #3299 from tloncorp/hm/fix-channel-redirects-fresh…
Browse files Browse the repository at this point in the history
…-load

groups: better data loading flow
  • Loading branch information
arthyn authored Mar 1, 2024
2 parents 96937bc + b2d72dc commit 6321465
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/tlon-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tlon-web",
"version": "5.5.0",
"version": "5.7.0",
"private": true,
"scripts": {
"rube": "tsc ./rube/index.ts --outDir ./rube/dist && node ./rube/dist/index.js",
Expand Down
7 changes: 2 additions & 5 deletions apps/tlon-web/src/state/groups/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,8 @@ export function useGroup(flag: string, updating = false): Group | undefined {
path: `/groups/${flag}/v1`,
options: {
enabled: !!flag && flag !== '' && updating && connection,
placeholderData: group,
refetchOnMount: updating,
retry: true,
// prevents skeleton from flashing on unmount when we have cached data
keepPreviousData: true,
},
});

Expand All @@ -185,10 +182,10 @@ export function useGroup(flag: string, updating = false): Group | undefined {
}, [flag, updating, subscribe]);

if (rest.isLoading || rest.isError || data === undefined) {
return undefined;
return group;
}

return data;
return data || group;
}

export function useGroupIsLoading(flag: string) {
Expand Down
2 changes: 1 addition & 1 deletion desk/desk.docket-0
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
image+'https://bootstrap.urbit.org/tlon.svg?v=1'
glob-http+['https://bootstrap.urbit.org/glob-0vfhst0.i8lv2.as4pf.709s3.1q1qv.glob' 0vfhst0.i8lv2.as4pf.709s3.1q1qv]
base+'groups'
version+[5 5 1]
version+[5 7 0]
website+'https://tlon.io'
license+'MIT'
==

0 comments on commit 6321465

Please sign in to comment.