Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Commit

Permalink
Add custom trigger when opening feed settings
Browse files Browse the repository at this point in the history
  • Loading branch information
miklosaubert committed Feb 1, 2019
1 parent a17cd2d commit 7901807
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/slackapp/feed-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const showIntroMessage = (message, bot) => {
}
};

const showFeedSettings = (bot, message) => {
const showFeedSettings = (slackapp) => (bot, message) => {
const team = bot.team_info;
const { starFilter = 'all', canReply } = getChannelFeedSettingsOrDefault(team, message.channel);
const sourceMessage = {
Expand Down Expand Up @@ -135,6 +135,7 @@ const showFeedSettings = (bot, message) => {
console.log(err, res);
}
});
slackapp.trigger('feed_settings_dialog_opened', [bot]);
};

const handleNewFeedSettings = async (bot, message, slackapp) => {
Expand Down
2 changes: 1 addition & 1 deletion app/slackapp/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const setupAppHandlers = (slackapp, apiClient, enableReviewQueries) => {
const action = message.actions[0].value;
const actionHandlers = {
['step_1_write_reply']: handleReplyButton,
['open_feed_settings']: feedSettings.showFeedSettings,
['open_feed_settings']: feedSettings.showFeedSettings(slackapp),
['delete_feed_settings']: feedSettings.deleteFeedSettings(slackapp),
};
await actionHandlers[action](bot, message);
Expand Down

0 comments on commit 7901807

Please sign in to comment.