-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Support for Coil Subscription and limit hat selection to su…
…bscribets
- Loading branch information
1 parent
e11a66e
commit c8bed9e
Showing
5 changed files
with
78 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
import { emit } from 'kontra'; | ||
import { MONETIZATION_PROGRESS } from './gameEvents'; | ||
import { setIsSubscriber } from './store'; | ||
|
||
export const initMonetization = () => { | ||
if (document && document.monetization) { | ||
document.monetization.addEventListener('monetizationprogress', (evt) => | ||
emit(MONETIZATION_PROGRESS, evt) | ||
handleSubscription(evt) | ||
); | ||
} else { | ||
window.addEventListener('monetizationprogress', (evt) => | ||
emit(MONETIZATION_PROGRESS, evt) | ||
handleSubscription(evt) | ||
); | ||
} | ||
}; | ||
const handleSubscription = (evt) => { | ||
setIsSubscriber(); | ||
emit(MONETIZATION_PROGRESS, evt); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters