feat: detect telegram notif is enabled or no
This commit is contained in:
@@ -786,6 +786,7 @@ export interface PublicSettings {
|
||||
crypto_payment_enabled: boolean;
|
||||
crypto_only: boolean;
|
||||
nowpayments_currencies: string[];
|
||||
telegram_notifications_enabled: boolean;
|
||||
}
|
||||
|
||||
export const getPublicSettings = async (): Promise<PublicSettings> => {
|
||||
@@ -799,6 +800,7 @@ export const getPublicSettings = async (): Promise<PublicSettings> => {
|
||||
crypto_payment_enabled: false,
|
||||
crypto_only: false,
|
||||
nowpayments_currencies: [],
|
||||
telegram_notifications_enabled: false,
|
||||
};
|
||||
try {
|
||||
const { data } = await apiClient.get(`${V1}/app-settings`);
|
||||
@@ -817,6 +819,8 @@ export const getPublicSettings = async (): Promise<PublicSettings> => {
|
||||
nowpayments_currencies: Array.isArray(data.nowpayments_currencies)
|
||||
? data.nowpayments_currencies
|
||||
: [],
|
||||
telegram_notifications_enabled:
|
||||
data.telegram_notifications_enabled ?? false,
|
||||
};
|
||||
} catch {
|
||||
return defaults;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user