Skip to content

Commit

Permalink
Merge pull request #4912 from hippware/4905
Browse files Browse the repository at this point in the history
for #4905
  • Loading branch information
aksonov authored Mar 16, 2020
2 parents 4b6cd94 + b96970b commit 645a95b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 46 deletions.
4 changes: 2 additions & 2 deletions __tests__/wocky/friendshare.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Friend Share', () => {
// const differentLocation = {longitude: 1.1, latitude: 1.1, accuracy: 1}

beforeAll(async () => {
jest.setTimeout(30000)
jest.setTimeout(50000)
bob = await createUser()
alice = await createUser()
})
Expand Down Expand Up @@ -65,7 +65,6 @@ describe('Friend Share', () => {
friend = alice.profile!.friends.get(bob.profile!.id)
expect(friend!.shareType).toEqual(FriendShareTypeEnum.ALWAYS)
expect(friend!.ownShareType).toEqual(FriendShareTypeEnum.ALWAYS)
expect(friend!.sharesLocation).toBeTruthy()

// check sharing
await alice.setLocation(theLocation)
Expand Down Expand Up @@ -113,6 +112,7 @@ describe('Friend Share', () => {
// change location
await bob.setLocation(differentLocation)
await waitFor(() => !friend!.sharesLocation, 'end sharing location')
await waitFor(() => !bob.profile!.sharesLocation, 'end sharing location')
})

afterAll(async () => {
Expand Down
2 changes: 0 additions & 2 deletions src/model/EventList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -34,7 +33,6 @@ export const EventEntity = types.union(
EventFriendInvite,
EventBotInvite,
EventLocationShare,
EventLocationShareNearbyStart,
EventLocationShareNearbyEnd,
EventLocationShareEnd,
EventUserBeFriend
Expand Down
33 changes: 0 additions & 33 deletions src/model/EventLocationShareNearbyStart.ts

This file was deleted.

3 changes: 2 additions & 1 deletion src/model/Profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -98,6 +99,7 @@ export const Profile = types
},
setLocation(location: ILocationSnapshot) {
self._location = Location.create(location)
self.sharesLocation = true
self.maybeUpdateActivity()
},
setFriend: (friend: boolean) => {
Expand All @@ -124,7 +126,6 @@ export const Profile = types
}
if (ownShareType) {
self.ownShareType = ownShareType
self.sharesLocation = ownShareType === FriendShareTypeEnum.ALWAYS
}
superLoad(data)

Expand Down
8 changes: 0 additions & 8 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 645a95b

Please sign in to comment.