diff --git a/src/model/EventList.ts b/src/model/EventList.ts index 239c1e819..70db66e11 100644 --- a/src/model/EventList.ts +++ b/src/model/EventList.ts @@ -13,7 +13,6 @@ import {PaginableLoadType} from '../store/Transport' import {waitFor} from '../utils/utils' import {EventLocationShare, EventLocationShareType} from './EventLocationShare' import {EventLocationShareEnd} from './EventLocationShareEnd' -import {EventLocationShareNearbyStart} from './EventLocationShareNearbyStart' import {EventLocationShareNearbyEnd} from './EventLocationShareNearbyEnd' import {EventUserBeFriend, EventUserBeFriendType} from './EventUserBefriend' @@ -34,7 +33,6 @@ export const EventEntity = types.union( EventFriendInvite, EventBotInvite, EventLocationShare, - EventLocationShareNearbyStart, EventLocationShareNearbyEnd, EventLocationShareEnd, EventUserBeFriend diff --git a/src/model/EventLocationShareNearbyStart.ts b/src/model/EventLocationShareNearbyStart.ts deleted file mode 100644 index c989ee4d8..000000000 --- a/src/model/EventLocationShareNearbyStart.ts +++ /dev/null @@ -1,33 +0,0 @@ -import {types, Instance} from 'mobx-state-tree' -import {Event, IEventData} from './Event' -import {IProfilePartial, Profile} from './Profile' -import {Base} from './Base' -import {EventRequestTypes} from './EventList' - -export const EventLocationShareNearbyStartType = 'LOCATION_SHARE_NEARBY_START_NOTIFICATION' -export const EventLocationShareNearbyStart = types - .compose( - Base, - Event, - types.model({ - sharedNearbyWith: types.reference(Profile), - }) - ) - .views(() => ({ - get isRequest() { - return EventRequestTypes.includes(EventLocationShareNearbyStartType) - }, - })) - .actions(self => ({ - process: () => { - self.sharedNearbyWith.setSharesLocation(true) - }, - })) - .named('EventLocationShareNearbyStart') - -export interface IEventLocationShareNearbyStart - extends Instance {} - -export interface IEventLocationShareNearbyStartData extends IEventData { - sharedNearbyWith: IProfilePartial -} diff --git a/src/model/Profile.ts b/src/model/Profile.ts index 697c703ce..59bd6c689 100644 --- a/src/model/Profile.ts +++ b/src/model/Profile.ts @@ -66,6 +66,7 @@ export const Profile = types const res = {...snapshot} delete res.status delete res.statusUpdatedAt + delete res.sharesLocation // delete res.location - need to preserve location because now it is passed only via subscriptions delete res.subscribedBots return res @@ -98,6 +99,7 @@ export const Profile = types }, setLocation(location: ILocationSnapshot) { self._location = Location.create(location) + self.sharesLocation = true self.maybeUpdateActivity() }, setFriend: (friend: boolean) => { @@ -124,7 +126,6 @@ export const Profile = types } if (ownShareType) { self.ownShareType = ownShareType - self.sharesLocation = ownShareType === FriendShareTypeEnum.ALWAYS } superLoad(data) diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 3f813b685..329a2b066 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -11,7 +11,6 @@ import {ILocationSnapshot} from '../model/Location' import {IMessageIn} from '../model/Message' import {IEventLocationShareEndData} from '../model/EventLocationShareEnd' import {IEventLocationShareData} from '../model/EventLocationShare' -import {IEventLocationShareNearbyStartData} from '../model/EventLocationShareNearbyStart' import {IEventLocationShareNearbyEndData} from '../model/EventLocationShareNearbyEnd' import {IEventUserBeFriendData} from '../model/EventUserBefriend' @@ -487,13 +486,6 @@ export function convertNotification(edge: any): IEventData | {deletedId: string} id, } return locationShareNotification - case 'LocationShareNearbyStartNotification': - const locationShareNearbyStartNotification: IEventLocationShareNearbyStartData = { - time, - sharedNearbyWith: convertProfile({...data.user, _accessedAt: time}), - id, - } - return locationShareNearbyStartNotification case 'LocationShareNearbyEndNotification': const locationShareNearbyEndNotification: IEventLocationShareNearbyEndData = { time,