Skip to content

Commit

Permalink
Merge pull request #1288 from consolelabs/fix/init-notification-flags
Browse files Browse the repository at this point in the history
fix: init notification flags
  • Loading branch information
anhnh12 authored Dec 21, 2023
2 parents 0710027 + 3e7829b commit 54e1e73
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ INSERT INTO
notification_flags ("group", "key", "description")
VALUES
('wallet', 'disable_all', 'Disable all notification wallets'),
('wallet', 'receive_transfer_success', 'Receive a tip'),
('wallet', 'receive_airdrop_success', 'Receive airdrops'),
('wallet', 'receive_deposit_success', 'Deposit completed'),
('wallet', 'send_withdraw_success', 'Withdrawal completed'),
Expand Down
17 changes: 0 additions & 17 deletions pkg/entities/setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,6 @@ func (e *Entity) UpdateUserGeneralSettings(uri request.UserSettingBaseUriRequest
return &payment, &privacy, nil
}

var notificationSettings []model.NotificationFlag = []model.NotificationFlag{
{Group: model.NotificationGroupWallet, Key: "disable_all", Description: "Disable all notification wallets"},
{Group: model.NotificationGroupWallet, Key: "receive_airdrop_success", Description: "Receive airdrops"},
{Group: model.NotificationGroupWallet, Key: "receive_deposit_success", Description: "Deposit completed"},
{Group: model.NotificationGroupWallet, Key: "send_withdraw_success", Description: "Withdrawal completed"},
{Group: model.NotificationGroupWallet, Key: "receive_payme_success", Description: "Payment request completed"},
{Group: model.NotificationGroupWallet, Key: "*_payme_expired", Description: "Payment request expired"},
{Group: model.NotificationGroupWallet, Key: "*_paylink_expired", Description: "Pay link has expired"},
{Group: model.NotificationGroupWallet, Key: "send_paylink_success", Description: "Pay link claimed by another"},
{Group: model.NotificationGroupWallet, Key: "receive_paylink_success", Description: "Claim a pay link"},
{Group: model.NotificationGroupCommunity, Key: "new_configuration", Description: "New configuration"},
{Group: model.NotificationGroupApp, Key: "new_vault_tx", Description: "New vault transactions"},
{Group: model.NotificationGroupApp, Key: "new_api_call", Description: "New API calls"},
{Group: model.NotificationGroupApp, Key: "info_updated", Description: "Information changes"},
{Group: model.NotificationGroupApp, Key: "new_member", Description: "New members"},
}

func (e *Entity) initUserNotiSetting(profileId string, settings []model.NotificationFlag) model.UserNotificationSetting {
userFlags := make(map[string]bool)
for _, f := range settings {
Expand Down

0 comments on commit 54e1e73

Please sign in to comment.