Added an periodical backup to the telegram bot
This commit is contained in:
@@ -43,7 +43,6 @@ class AppSettings @Inject constructor(@ApplicationContext context: Context) {
|
||||
private val connectivityManager = context.connectivityManager
|
||||
private val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
||||
|
||||
var telegramChatId: String?
|
||||
get() = preferences.getString("telegram_chat_id", null)
|
||||
set(value) {
|
||||
|
||||
@@ -52,7 +52,6 @@ class PeriodicalBackupSettingsFragment : BasePreferenceFragment(R.string.periodi
|
||||
openTelegramBot("kotatsu_backup_bot")
|
||||
true
|
||||
}
|
||||
// Кнопка для проверки работы API
|
||||
val checkApiButton = Preference(requireContext()).apply {
|
||||
key = "check_api_working"
|
||||
title = "Проверить работу API"
|
||||
@@ -102,7 +101,6 @@ class PeriodicalBackupSettingsFragment : BasePreferenceFragment(R.string.periodi
|
||||
telegramIntent.setPackage("org.telegram.messenger")
|
||||
startActivity(telegramIntent)
|
||||
} catch (e: Exception) {
|
||||
// Если Telegram не установлен, открываем через браузер
|
||||
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse("https://t.me/$botUsername"))
|
||||
startActivity(browserIntent)
|
||||
}
|
||||
|
||||
@@ -151,3 +151,4 @@ class PeriodicalBackupWorker @AssistedInject constructor(
|
||||
const val DATA_TIMESTAMP = "ts"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user