Skip to content

Commit

Permalink
remove follow action
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed Sep 20, 2021
1 parent e8db277 commit defbb41
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,6 @@ _notification:
app: "連携アプリからの通知"

_actions:
followBack: "フォローバック"
reply: "返信"
renote: "Renote"

Expand Down
10 changes: 0 additions & 10 deletions src/client/sw/create-notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,10 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
case 'notification':
switch (data.body.type) {
case 'follow':
// users/showの型定義をswos.apiへ当てはめるのが困難なのでapiFetch.requestを直接使用
const account = await getAccountFromId(data.userId);
if (!account) return null;
const userDetail = apiFetch.request('users/show', { userId: data.body.userId }, account.token);
return [t('_notification.youWereFollowed'), {
body: getUserName(data.body.user),
icon: data.body.user.avatarUrl,
data,
actions: userDetail.isFollowing ? [] : [
{
action: 'follow',
title: t('_notification._actions.followBack')
}
],
}];

case 'mention':
Expand Down
3 changes: 0 additions & 3 deletions src/client/sw/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ self.addEventListener('notificationclick', <K extends keyof pushNotificationData
switch (data.type) {
case 'notification':
switch (action) {
case 'follow':
if ('userId' in data.body) await swos.api('following/create', id, { userId: data.body.userId });
break;
case 'showUser':
if ('user' in data.body) client = await swos.openUser(getAcct(data.body.user), id);
break;
Expand Down

0 comments on commit defbb41

Please sign in to comment.