mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
rename thunk for consistency
This commit is contained in:
@@ -11,8 +11,8 @@ import {
|
|||||||
changeMarkAllAsReadConfirmation,
|
changeMarkAllAsReadConfirmation,
|
||||||
changeMarkAllAsReadNavigateToUnread,
|
changeMarkAllAsReadNavigateToUnread,
|
||||||
changeMobileFooter,
|
changeMobileFooter,
|
||||||
changeNotificationSettings,
|
|
||||||
changePrimaryColor,
|
changePrimaryColor,
|
||||||
|
changePushNotificationSettings,
|
||||||
changeReadingMode,
|
changeReadingMode,
|
||||||
changeReadingOrder,
|
changeReadingOrder,
|
||||||
changeScrollMarks,
|
changeScrollMarks,
|
||||||
@@ -149,7 +149,7 @@ export const userSlice = createSlice({
|
|||||||
if (!state.settings) return
|
if (!state.settings) return
|
||||||
state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value
|
state.settings.sharingSettings[action.meta.arg.site] = action.meta.arg.value
|
||||||
})
|
})
|
||||||
builder.addCase(changeNotificationSettings.pending, (state, action) => {
|
builder.addCase(changePushNotificationSettings.pending, (state, action) => {
|
||||||
if (!state.settings) return
|
if (!state.settings) return
|
||||||
state.settings.pushNotificationSettings = action.meta.arg
|
state.settings.pushNotificationSettings = action.meta.arg
|
||||||
})
|
})
|
||||||
@@ -173,7 +173,7 @@ export const userSlice = createSlice({
|
|||||||
changeDisablePullToRefresh.fulfilled,
|
changeDisablePullToRefresh.fulfilled,
|
||||||
changePrimaryColor.fulfilled,
|
changePrimaryColor.fulfilled,
|
||||||
changeSharingSetting.fulfilled,
|
changeSharingSetting.fulfilled,
|
||||||
changeNotificationSettings.fulfilled
|
changePushNotificationSettings.fulfilled
|
||||||
),
|
),
|
||||||
() => {
|
() => {
|
||||||
showNotification({
|
showNotification({
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ export const changeSharingSetting = createAppAsyncThunk(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
export const changeNotificationSettings = createAppAsyncThunk(
|
export const changePushNotificationSettings = createAppAsyncThunk(
|
||||||
"settings/notificationSettings",
|
"settings/pushNotificationSettings",
|
||||||
(pushNotificationSettings: PushNotificationSettings, thunkApi) => {
|
(pushNotificationSettings: PushNotificationSettings, thunkApi) => {
|
||||||
const { settings } = thunkApi.getState().user
|
const { settings } = thunkApi.getState().user
|
||||||
if (!settings) return
|
if (!settings) return
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { client, errorToStrings } from "@/app/client"
|
|||||||
import { redirectToSelectedSource } from "@/app/redirect/thunks"
|
import { redirectToSelectedSource } from "@/app/redirect/thunks"
|
||||||
import { useAppDispatch, useAppSelector } from "@/app/store"
|
import { useAppDispatch, useAppSelector } from "@/app/store"
|
||||||
import type { PushNotificationSettings as PushNotificationSettingsModel } from "@/app/types"
|
import type { PushNotificationSettings as PushNotificationSettingsModel } from "@/app/types"
|
||||||
import { changeNotificationSettings } from "@/app/user/thunks"
|
import { changePushNotificationSettings } from "@/app/user/thunks"
|
||||||
import { Alert } from "@/components/Alert"
|
import { Alert } from "@/components/Alert"
|
||||||
|
|
||||||
export function PushNotificationSettings() {
|
export function PushNotificationSettings() {
|
||||||
@@ -25,7 +25,7 @@ export function PushNotificationSettings() {
|
|||||||
}, [form.initialize, notificationSettings])
|
}, [form.initialize, notificationSettings])
|
||||||
|
|
||||||
const handleSubmit = (values: PushNotificationSettingsModel) => {
|
const handleSubmit = (values: PushNotificationSettingsModel) => {
|
||||||
dispatch(changeNotificationSettings(values))
|
dispatch(changePushNotificationSettings(values))
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendTestPushNotification = useAsyncCallback(client.user.sendTestPushNotification)
|
const sendTestPushNotification = useAsyncCallback(client.user.sendTestPushNotification)
|
||||||
|
|||||||
Reference in New Issue
Block a user