feat: deprecate old notification module and introduce new notifier module

This commit is contained in:
Fu Diwei
2025-04-24 20:27:20 +08:00
parent 2d17501072
commit 7478dd7f47
27 changed files with 692 additions and 265 deletions

View File

@@ -4,6 +4,9 @@ import { create } from "zustand";
import { type NotifyChannelsSettingsContent, SETTINGS_NAMES, type SettingsModel } from "@/domain/settings";
import { get as getSettings, save as saveSettings } from "@/repository/settings";
/**
* @deprecated
*/
export interface NotifyChannelsState {
channels: NotifyChannelsSettingsContent;
loading: boolean;
@@ -14,6 +17,9 @@ export interface NotifyChannelsState {
setChannels: (channels: NotifyChannelsSettingsContent) => Promise<void>;
}
/**
* @deprecated
*/
export const useNotifyChannelsStore = create<NotifyChannelsState>((set, get) => {
let fetcher: Promise<SettingsModel<NotifyChannelsSettingsContent>> | null = null; // 防止多次重复请求
let settings: SettingsModel<NotifyChannelsSettingsContent>; // 记录当前设置的其他字段,保存回数据库时用