Skip to content

Commit

Permalink
Adding Manually Update Plugins Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
phisher98 committed Jan 30, 2025
1 parent d4ebe7b commit c34ac65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -262,16 +262,15 @@ class SettingsUpdates : PreferenceFragmentCompat() {
}

getPref(R.string.manual_update_plugins_key)?.setOnPreferenceClickListener {
val activity = activity ?: return@setOnPreferenceClickListener false // Safely handle null activity
try {
showToast("Updating extensions...", Toast.LENGTH_SHORT)
PluginManager.manuallyReloadAndUpdatePlugins(activity)
PluginManager.manuallyReloadAndUpdatePlugins(requireActivity())
} catch (e: Throwable) { // Use Throwable to catch and handle all errors
// Show error toast using the utility method and re-throw the exception
showToast(R.string.backup_failed, Toast.LENGTH_LONG)
throw e
}
true // Return true for the listener
return@setOnPreferenceClickListener true // Return true for the listener
}
}

Expand Down

0 comments on commit c34ac65

Please sign in to comment.