@streamlayer/feature-gamification
Advanced tools
Comparing version 0.20.0 to 0.21.0
@@ -9,2 +9,3 @@ import { AbstractFeature, ApiStore, FeatureSource, type FeatureProps, type StreamLayerContext } from '@streamlayer/sdk-web-interfaces'; | ||
import { leaderboard } from './leaderboard'; | ||
import { LeaderboardItem } from './queries/leaderboard'; | ||
import { GamificationBackground } from './'; | ||
@@ -48,2 +49,4 @@ /** | ||
openedQuestion: GamificationBackground['openedQuestion']; | ||
/** pinned leaderboard id */ | ||
openedUser: WritableAtom<LeaderboardItem | undefined>; | ||
private notifications; | ||
@@ -71,2 +74,4 @@ private transport; | ||
closeQuestion: (questionId?: string) => void; | ||
openUser: (userId: string) => void; | ||
closeUser: () => void; | ||
} |
@@ -49,2 +49,4 @@ import { AbstractFeature, ApiStore, FeatureStatus, SingleStore, createSingleStore, } from '@streamlayer/sdk-web-interfaces'; | ||
openedQuestion; | ||
/** pinned leaderboard id */ | ||
openedUser; | ||
notifications; | ||
@@ -64,2 +66,3 @@ transport; | ||
this.feedList = this.background.feedList; | ||
this.openedUser = createSingleStore(undefined); | ||
this.leaderboardId = new SingleStore(createSingleStore(this.settings.getValue('pinnedLeaderboardId')), 'pinnedLeaderboardId').getStore(); | ||
@@ -261,2 +264,9 @@ this.onboardingStatus = new SingleStore(createSingleStore(OnboardingStatus.Unset), 'onboardingStatus').getStore(); | ||
}; | ||
openUser = (userId) => { | ||
const user = this.leaderboardList.$store.get().data?.find((item) => item.userId === userId); | ||
this.openedUser.set(user); | ||
}; | ||
closeUser = () => { | ||
this.openedUser.set(undefined); | ||
}; | ||
} |
{ | ||
"name": "@streamlayer/feature-gamification", | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"peerDependencies": { | ||
@@ -13,4 +13,4 @@ "@bufbuild/protobuf": "^1.4.2", | ||
"@streamlayer/sdk-web-storage": "^0.3.10", | ||
"@streamlayer/sdk-web-logger": "^0.5.10", | ||
"@streamlayer/sdk-web-notifications": "^0.10.9" | ||
"@streamlayer/sdk-web-notifications": "^0.10.9", | ||
"@streamlayer/sdk-web-logger": "^0.5.10" | ||
}, | ||
@@ -17,0 +17,0 @@ "devDependencies": { |
72602
1311