diff --git a/src/state/models/scene-invite-suggestions.ts b/src/state/models/suggested-invites.ts similarity index 88% rename from src/state/models/scene-invite-suggestions.ts rename to src/state/models/suggested-invites.ts index 34bb5c28..1b080163 100644 --- a/src/state/models/scene-invite-suggestions.ts +++ b/src/state/models/suggested-invites.ts @@ -2,28 +2,26 @@ import {makeAutoObservable, runInAction} from 'mobx' import {RootStoreModel} from './root-store' import {MembersViewModel} from './members-view' import {UserFollowsViewModel, FollowItem} from './user-follows-view' +import {APP_BSKY_SYSTEM} from '../../third-party/api' -export interface SceneInviteSuggestionsParams { +export interface SuggestedInvites { sceneDid: string } -export class SceneInviteSuggestions { +export class SuggestedInvites { // state isLoading = false isRefreshing = false hasLoaded = false error = '' - params: SceneInviteSuggestionsParams + params: SuggestedInvites sceneMembersView: MembersViewModel myFollowsView: UserFollowsViewModel // data suggestions: FollowItem[] = [] - constructor( - public rootStore: RootStoreModel, - params: SceneInviteSuggestionsParams, - ) { + constructor(public rootStore: RootStoreModel, params: SuggestedInvites) { makeAutoObservable( this, { @@ -111,7 +109,9 @@ export class SceneInviteSuggestions { // collect all followed users that arent already in the scene const newSuggestions: FollowItem[] = [] for (const follow of this.myFollowsView.follows) { - // TODO: filter out scenes + if (follow.declaration.actorType !== APP_BSKY_SYSTEM.ActorUser) { + continue + } if ( !this.sceneMembersView.members.find(member => member.did === follow.did) ) { diff --git a/src/view/com/modals/InviteToScene.tsx b/src/view/com/modals/InviteToScene.tsx index f1c9d338..065df635 100644 --- a/src/view/com/modals/InviteToScene.tsx +++ b/src/view/com/modals/InviteToScene.tsx @@ -23,7 +23,7 @@ import {ErrorMessage} from '../util/ErrorMessage' import {useStores} from '../../../state' import * as apilib from '../../../state/lib/api' import {ProfileViewModel} from '../../../state/models/profile-view' -import {SceneInviteSuggestions} from '../../../state/models/scene-invite-suggestions' +import {SuggestedInvites} from '../../../state/models/suggested-invites' import {FollowItem} from '../../../state/models/user-follows-view' import {s, colors} from '../../lib/styles' @@ -40,7 +40,7 @@ export function Component({profileView}: {profileView: ProfileViewModel}) { const [hasSetup, setHasSetup] = useState(false) const [error, setError] = useState('') const suggestions = useMemo( - () => new SceneInviteSuggestions(store, {sceneDid: profileView.did}), + () => new SuggestedInvites(store, {sceneDid: profileView.did}), [profileView.did], ) const [createdInvites, setCreatedInvites] = useState>( diff --git a/todos.txt b/todos.txt index dd2b42c3..08fdb07d 100644 --- a/todos.txt +++ b/todos.txt @@ -16,7 +16,6 @@ Paul's todo list - * - Invite to scene - User search - > Filter out scenes from suggestions > Filter out unconfirmed invites from suggestions - Use pagination to make sure there are suggestions - Unconfirmed invites