Skip to content

Commit 77da6e3

Browse files
committed
Update Stream fields: userAddress → userId
1 parent 19d7f34 commit 77da6e3

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/generated/gql/network.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5324,14 +5324,14 @@ export type GetProjectSubscriptionsQueryVariables = Exact<{
53245324

53255325
export type GetProjectSubscriptionsQuery = { __typename?: 'Query', project?: { __typename?: 'Project', subscriptions: Array<{ __typename?: 'ProjectSubscription', userAddress: any, endTimestamp?: any | null }> } | null };
53265326

5327-
export type StreamFieldsFragment = { __typename?: 'Stream', id: string, metadata: string, permissions?: Array<{ __typename?: 'StreamPermission', id: string, canGrant?: boolean | null, canEdit?: boolean | null, canDelete?: boolean | null, userAddress?: any | null, subscribeExpiration?: any | null, publishExpiration?: any | null }> | null };
5327+
export type StreamFieldsFragment = { __typename?: 'Stream', id: string, metadata: string, permissions?: Array<{ __typename?: 'StreamPermission', id: string, canGrant?: boolean | null, canEdit?: boolean | null, canDelete?: boolean | null, userId: any, subscribeExpiration?: any | null, publishExpiration?: any | null }> | null };
53285328

53295329
export type GetStreamByIdQueryVariables = Exact<{
53305330
streamId: Scalars['ID']['input'];
53315331
}>;
53325332

53335333

5334-
export type GetStreamByIdQuery = { __typename?: 'Query', stream?: { __typename?: 'Stream', id: string, metadata: string, permissions?: Array<{ __typename?: 'StreamPermission', id: string, canGrant?: boolean | null, canEdit?: boolean | null, canDelete?: boolean | null, userAddress?: any | null, subscribeExpiration?: any | null, publishExpiration?: any | null }> | null } | null };
5334+
export type GetStreamByIdQuery = { __typename?: 'Query', stream?: { __typename?: 'Stream', id: string, metadata: string, permissions?: Array<{ __typename?: 'StreamPermission', id: string, canGrant?: boolean | null, canEdit?: boolean | null, canDelete?: boolean | null, userId: any, subscribeExpiration?: any | null, publishExpiration?: any | null }> | null } | null };
53355335

53365336
export type GetPagedStreamsQueryVariables = Exact<{
53375337
first?: InputMaybe<Scalars['Int']['input']>;
@@ -5341,7 +5341,7 @@ export type GetPagedStreamsQueryVariables = Exact<{
53415341
}>;
53425342

53435343

5344-
export type GetPagedStreamsQuery = { __typename?: 'Query', streams: Array<{ __typename?: 'Stream', id: string, metadata: string, permissions?: Array<{ __typename?: 'StreamPermission', id: string, canGrant?: boolean | null, canEdit?: boolean | null, canDelete?: boolean | null, userAddress?: any | null, subscribeExpiration?: any | null, publishExpiration?: any | null }> | null }> };
5344+
export type GetPagedStreamsQuery = { __typename?: 'Query', streams: Array<{ __typename?: 'Stream', id: string, metadata: string, permissions?: Array<{ __typename?: 'StreamPermission', id: string, canGrant?: boolean | null, canEdit?: boolean | null, canDelete?: boolean | null, userId: any, subscribeExpiration?: any | null, publishExpiration?: any | null }> | null }> };
53455345

53465346
export type SponsorshipDailyBucketFieldsFragment = { __typename?: 'SponsorshipDailyBucket', id: string, operatorCount: number, projectedInsolvency?: any | null, spotAPY: any, totalStakedWei: any, remainingWei: any, date: any, sponsorship: { __typename?: 'Sponsorship', id: string } };
53475347

@@ -5534,7 +5534,7 @@ export const StreamFieldsFragmentDoc = gql`
55345534
canGrant
55355535
canEdit
55365536
canDelete
5537-
userAddress
5537+
userId
55385538
subscribeExpiration
55395539
publishExpiration
55405540
}

src/hooks/streams.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export async function getStreamsFromIndexer(
117117
const where: Stream_Filter = {
118118
permissions_: {
119119
stream_contains_nocase: search,
120-
userAddress: owner,
120+
userId: owner,
121121
},
122122
}
123123

@@ -221,7 +221,7 @@ async function getStreamsFromGraph(
221221
const where: Stream_Filter = {
222222
permissions_: {
223223
stream_contains_nocase: search,
224-
userAddress: owner,
224+
userId: owner,
225225
},
226226
[`id_${orderOperator}`]: lastId,
227227
id_in: streamIds,
@@ -231,8 +231,8 @@ async function getStreamsFromGraph(
231231
delete where.permissions_?.stream_contains_nocase
232232
}
233233

234-
if (!where.permissions_?.userAddress) {
235-
delete where.permissions_?.userAddress
234+
if (!where.permissions_?.userId) {
235+
delete where.permissions_?.userId
236236
}
237237

238238
if (Object.keys(where.permissions_ || {}).length === 0) {
@@ -369,7 +369,7 @@ function getStatsFromPermissions(
369369
let publisherCount: number | undefined = 0
370370

371371
permissions.forEach((perm) => {
372-
if (perm.userAddress === address0) {
372+
if (perm.userId === address0) {
373373
/**
374374
* If stream has public permissions (zero address), return `undefined`
375375
* for counts. It means anyone can publish and subscribe.

src/queries/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ gql`
394394
canGrant
395395
canEdit
396396
canDelete
397-
userAddress
397+
userId
398398
subscribeExpiration
399399
publishExpiration
400400
}

src/services/streams.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { getGraphClient } from '~/getters/getGraphClient'
1818
import { OrderDirection } from '~/types'
1919

2020
export type TheGraphStreamPermission = {
21-
userAddress: string
21+
userId: string
2222
canEdit: boolean
2323
canGrant: boolean
2424
canDelete: boolean
@@ -51,7 +51,7 @@ const calculatePubSubCount = (permissions: StreamPermission[]) => {
5151
permissions.forEach((perm) => {
5252
// If stream has public permissions (zero address), return null for counts which means that anyone can
5353
// publish or subscribe
54-
if (perm.userAddress === address0) {
54+
if (perm.userId === address0) {
5555
if (perm.subscribeExpiration >= Math.round(Date.now() / 1000)) {
5656
subscriberCount = null
5757
}
@@ -145,7 +145,7 @@ export const getPagedStreams = async (
145145
let where: Stream_Filter = {
146146
permissions_: {
147147
stream_contains_nocase: search,
148-
userAddress: owner,
148+
userId: owner,
149149
},
150150
[`id_${orderOperator}`]: lastId,
151151
}
@@ -219,7 +219,7 @@ export const getStreamsOwnedBy = async (
219219
result = result.filter(
220220
(s) =>
221221
s.permissions.find(
222-
(p) => p.userAddress.toLowerCase() === address0.toLowerCase(),
222+
(p) => p.userId.toLowerCase() === address0.toLowerCase(),
223223
) != null,
224224
)
225225
}

0 commit comments

Comments
 (0)