mirror of
https://github.com/Athou/commafeed.git
synced 2026-11-02 18:34:48 +00:00
feat: send notification for new entries with Gotify, ntfy or Pushover, configurable per feed.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { createAppAsyncThunk } from "@/app/async-thunk"
|
||||
import { client } from "@/app/client"
|
||||
import { reloadEntries } from "@/app/entries/thunks"
|
||||
import type { IconDisplayMode, ReadingMode, ReadingOrder, ScrollMode, SharingSettings } from "@/app/types"
|
||||
import type { IconDisplayMode, NotificationSettings, ReadingMode, ReadingOrder, ScrollMode, SharingSettings } from "@/app/types"
|
||||
|
||||
export const reloadSettings = createAppAsyncThunk("settings/reload", async () => await client.user.getSettings().then(r => r.data))
|
||||
|
||||
@@ -157,3 +157,18 @@ export const changeSharingSetting = createAppAsyncThunk(
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
export const changeNotificationSettings = createAppAsyncThunk(
|
||||
"settings/notificationSettings",
|
||||
(notificationUpdate: Partial<NotificationSettings>, thunkApi) => {
|
||||
const { settings } = thunkApi.getState().user
|
||||
if (!settings) return
|
||||
client.user.saveSettings({
|
||||
...settings,
|
||||
notificationSettings: {
|
||||
...settings.notificationSettings,
|
||||
...notificationUpdate,
|
||||
},
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user