mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-23 00:29:22 +09:00
remove follow action
This commit is contained in:
parent
e8db277589
commit
defbb41648
@ -1709,7 +1709,6 @@ _notification:
|
|||||||
app: "連携アプリからの通知"
|
app: "連携アプリからの通知"
|
||||||
|
|
||||||
_actions:
|
_actions:
|
||||||
followBack: "フォローバック"
|
|
||||||
reply: "返信"
|
reply: "返信"
|
||||||
renote: "Renote"
|
renote: "Renote"
|
||||||
|
|
||||||
|
@ -38,20 +38,10 @@ async function composeNotification<K extends keyof pushNotificationDataMap>(data
|
|||||||
case 'notification':
|
case 'notification':
|
||||||
switch (data.body.type) {
|
switch (data.body.type) {
|
||||||
case 'follow':
|
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'), {
|
return [t('_notification.youWereFollowed'), {
|
||||||
body: getUserName(data.body.user),
|
body: getUserName(data.body.user),
|
||||||
icon: data.body.user.avatarUrl,
|
icon: data.body.user.avatarUrl,
|
||||||
data,
|
data,
|
||||||
actions: userDetail.isFollowing ? [] : [
|
|
||||||
{
|
|
||||||
action: 'follow',
|
|
||||||
title: t('_notification._actions.followBack')
|
|
||||||
}
|
|
||||||
],
|
|
||||||
}];
|
}];
|
||||||
|
|
||||||
case 'mention':
|
case 'mention':
|
||||||
|
@ -108,9 +108,6 @@ self.addEventListener('notificationclick', <K extends keyof pushNotificationData
|
|||||||
switch (data.type) {
|
switch (data.type) {
|
||||||
case 'notification':
|
case 'notification':
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'follow':
|
|
||||||
if ('userId' in data.body) await swos.api('following/create', id, { userId: data.body.userId });
|
|
||||||
break;
|
|
||||||
case 'showUser':
|
case 'showUser':
|
||||||
if ('user' in data.body) client = await swos.openUser(getAcct(data.body.user), id);
|
if ('user' in data.body) client = await swos.openUser(getAcct(data.body.user), id);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user