@streamlayer/feature-gamification
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -76,2 +76,3 @@ import { ApiStore, createMapStore, eventBus } from '@streamlayer/sdk-web-interfaces'; | ||
if (!persistent && storage.isShowed(advertisement.id)) { | ||
queue.removeFromList(advertisement.id); | ||
return getActiveAdvertisement(persistent); | ||
@@ -78,0 +79,0 @@ } |
@@ -20,2 +20,3 @@ import { SingleStore, createComputedStore } from '@streamlayer/sdk-web-interfaces'; | ||
tickActiveQueue: (advertisementId: string) => void; | ||
removeFromList: (advertisementId: string) => void; | ||
closeAdvertisement: (advertisementId: string, { animateHiding }?: { | ||
@@ -22,0 +23,0 @@ animateHiding?: boolean | undefined; |
@@ -97,2 +97,11 @@ import { createSingleStore } from '@streamlayer/sdk-web-interfaces'; | ||
}; | ||
removeFromList = (advertisementId) => { | ||
const prevQueue = new Map(this.advertisementList.get()); | ||
prevQueue.delete(advertisementId); | ||
this.advertisementList.set(prevQueue); | ||
this.store.delete(advertisementId); | ||
this.activeQueue.delete(advertisementId); | ||
this.waitingQueue.delete(advertisementId); | ||
this.logger.debug({ advertisementId }, 'advertisement removed from list'); | ||
}; | ||
closeAdvertisement = (advertisementId, { animateHiding = true } = {}) => { | ||
@@ -116,3 +125,3 @@ const prevQueue = new Map(this.advertisementList.get()); | ||
this.logger.debug({ advertisementId }, 'advertisement hidden'); | ||
}, this.options.animationDelay || 0); | ||
}, animateHiding ? this.options.animationDelay || 0 : 0); | ||
this.timeouts.set(advertisementId, timeout); | ||
@@ -119,0 +128,0 @@ } |
{ | ||
"name": "@streamlayer/feature-gamification", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"peerDependencies": { | ||
@@ -9,9 +9,9 @@ "@bufbuild/protobuf": "^1.10.0", | ||
"nanostores": "^0.10.3", | ||
"@streamlayer/sdk-web-api": "^1.2.1", | ||
"@streamlayer/sdk-web-core": "^1.1.1", | ||
"@streamlayer/sdk-web-interfaces": "^1.1.1", | ||
"@streamlayer/sdk-web-logger": "^1.0.6", | ||
"@streamlayer/sdk-web-notifications": "^1.1.1", | ||
"@streamlayer/sdk-web-storage": "^1.0.6", | ||
"@streamlayer/sdk-web-types": "^1.2.1" | ||
"@streamlayer/sdk-web-api": "^1.2.2", | ||
"@streamlayer/sdk-web-core": "^1.1.2", | ||
"@streamlayer/sdk-web-interfaces": "^1.1.2", | ||
"@streamlayer/sdk-web-logger": "^1.0.7", | ||
"@streamlayer/sdk-web-notifications": "^1.1.2", | ||
"@streamlayer/sdk-web-storage": "^1.0.7", | ||
"@streamlayer/sdk-web-types": "^1.2.2" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
124087
2483