From be4eaa93ee478d67cbb3989cadc3f7deba46ad83 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Fri, 16 Dec 2022 10:35:31 +0100 Subject: [PATCH] Fix push --- README.md | 2 ++ src/components/openLink.ts | 1 - src/i18n/en/screens/tabs.json | 3 +++ src/utils/slices/instances/push/register.ts | 7 +++---- src/utils/slices/instances/updatePushAlert.ts | 7 +++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b1bcf7e3..7d29999d 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ Please **do not** create a pull request to update translation. tooot's translati [@janlindblom](https://github.com/janlindblom) for Swedish +[@ihoryan](https://crowdin.com/profile/ihoryan) for Ukrainian + [@duy@mas.to](https://mas.to/@duy) for Vietnamese translation [@jimmyorz](https://github.com/jimmyorz) for Traditional Chinese translation diff --git a/src/components/openLink.ts b/src/components/openLink.ts index 30425685..fc1dea57 100644 --- a/src/components/openLink.ts +++ b/src/components/openLink.ts @@ -17,7 +17,6 @@ const openLink = async (url: string, navigation?: any) => { const handleNavigation = (page: 'Tab-Shared-Toot' | 'Tab-Shared-Account', options: {}) => { if (navigation) { - // @ts-ignore navigation.push(page, options) } else { // @ts-ignore diff --git a/src/i18n/en/screens/tabs.json b/src/i18n/en/screens/tabs.json index 5d7d1f2d..d0f8d2e7 100644 --- a/src/i18n/en/screens/tabs.json +++ b/src/i18n/en/screens/tabs.json @@ -231,6 +231,9 @@ "status": { "heading": "Toot from subscribed users" }, + "update": { + "heading": "Reblog has been edited" + }, "admin.sign_up": { "heading": "Admin: sign up" }, diff --git a/src/utils/slices/instances/push/register.ts b/src/utils/slices/instances/push/register.ts index f6185a7a..93a339a8 100644 --- a/src/utils/slices/instances/push/register.ts +++ b/src/utils/slices/instances/push/register.ts @@ -62,10 +62,9 @@ const pushRegister = async ( 'BMn2PLpZrMefG981elzG6SB1EY9gU7QZwmtZ/a/J2vUeWG+zXgeskMPwHh4T/bxsD4l7/8QT94F57CbZqYRRfJo=' ) formData.append('subscription[keys][auth]', auth) - Object.keys(alerts).map(key => - // @ts-ignore - formData.append(`data[alerts][${key}]`, alerts[key].value.toString()) - ) + for (const [key, value] of Object.entries(alerts)) { + formData.append(`data[alerts][${key}]`, value.toString()) + } const res = await apiInstance({ method: 'post', diff --git a/src/utils/slices/instances/updatePushAlert.ts b/src/utils/slices/instances/updatePushAlert.ts index d4cbb0ee..60d8c864 100644 --- a/src/utils/slices/instances/updatePushAlert.ts +++ b/src/utils/slices/instances/updatePushAlert.ts @@ -10,10 +10,9 @@ export const updateInstancePushAlert = createAsyncThunk( alerts: InstanceLatest['push']['alerts'] }): Promise => { const formData = new FormData() - Object.keys(alerts).map(alert => - // @ts-ignore - formData.append(`data[alerts][${alert}]`, alerts[alert].value.toString()) - ) + for (const [key, value] of Object.entries(alerts)) { + formData.append(`data[alerts][${key}]`, value.toString()) + } await apiInstance({ method: 'put',