Skip to content

Commit 6c76823

Browse files
author
Gene Hynson
authored
fix(sub): do not get subs twice (#6080)
1 parent 2c4fe62 commit 6c76823

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/writeData/subscriptions/context/subscription.list.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,10 @@ export const SubscriptionListProvider: FC = ({children}) => {
124124
}
125125
}
126126
const change = useCallback(
127-
async (id: string): Promise<void> => {
128-
setLoading(RemoteDataState.Loading)
129-
if (!subscriptions) {
130-
await getAll()
127+
(id: string) => {
128+
if (subscriptions) {
129+
setCurrentID(id)
131130
}
132-
setCurrentID(id)
133-
setLoading(RemoteDataState.Done)
134131
},
135132
[setCurrentID, subscriptions]
136133
)

0 commit comments

Comments
 (0)