Skip to content

Commit

Permalink
Change notification from every 10 uses to once
Browse files Browse the repository at this point in the history
  • Loading branch information
gememma committed May 17, 2024
1 parent e6e246d commit 08dd5eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelog.d/114.added.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Users will ocassionally be invited to join the Discord server
Users will be invited to join the Discord server after 10 usages
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"mirrord.promptDiscord": {
"type": "boolean",
"default": true,
"description": "Occasionally show a notification inviting to the Discord server."
"description": "Show a notification inviting the user to the Discord server."
},
"mirrord.promptAgentVersionMismatch": {
"type": "boolean",
Expand Down
4 changes: 2 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,15 +557,15 @@ function tickFeedbackCounter() {

/**
* Updates the global Discord counter.
* After each `DISCORD_COUNTER_PROMPT_AFTER` mirrord runs, displays a message asking the user to join the discord.
* After `DISCORD_COUNTER_PROMPT_AFTER` mirrord runs, displays a message asking the user to join the discord.
*/
function tickDiscordCounter() {
const previousRuns = parseInt(globalContext.globalState.get(DISCORD_COUNTER) ?? '0');
const currentRuns = previousRuns + 1;

globalContext.globalState.update(DISCORD_COUNTER, currentRuns);

if ((currentRuns % DISCORD_COUNTER_PROMPT_AFTER) === 0) {
if ((currentRuns - DISCORD_COUNTER_PROMPT_AFTER) === 0) {
new NotificationBuilder()
.withMessage(`Need any help with mirrord? Come chat with our team on Discord!`)
.withGenericAction("Join us!", async () => {
Expand Down

0 comments on commit 08dd5eb

Please sign in to comment.