Telegram empty fields do not raise errors anymore if not using Telegram
This commit is contained in:
parent
cbb0f04ab0
commit
ce6499a3d2
|
|
@ -4,6 +4,22 @@
|
||||||
<selectionStates>
|
<selectionStates>
|
||||||
<SelectionState runConfigName="app">
|
<SelectionState runConfigName="app">
|
||||||
<option name="selectionMode" value="DROPDOWN" />
|
<option name="selectionMode" value="DROPDOWN" />
|
||||||
|
<DropdownSelection timestamp="2024-12-09T20:18:37.036237904Z">
|
||||||
|
<Target type="DEFAULT_BOOT">
|
||||||
|
<handle>
|
||||||
|
<DeviceId pluginId="LocalEmulator" identifier="path=/home/nicolas/.android/avd/Pixel_6_Pro_API_34.avd" />
|
||||||
|
</handle>
|
||||||
|
</Target>
|
||||||
|
</DropdownSelection>
|
||||||
|
<DialogSelection>
|
||||||
|
<targets>
|
||||||
|
<Target type="DEFAULT_BOOT">
|
||||||
|
<handle>
|
||||||
|
<DeviceId pluginId="LocalEmulator" identifier="path=/home/nicolas/.android/avd/Pixel_6_Pro_API_34.avd" />
|
||||||
|
</handle>
|
||||||
|
</Target>
|
||||||
|
</targets>
|
||||||
|
</DialogSelection>
|
||||||
</SelectionState>
|
</SelectionState>
|
||||||
</selectionStates>
|
</selectionStates>
|
||||||
</component>
|
</component>
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,20 @@ public class SettingsFragment extends Fragment {
|
||||||
int amountOfLastTrades = 0;
|
int amountOfLastTrades = 0;
|
||||||
|
|
||||||
//Check if the user entered valid strings
|
//Check if the user entered valid strings
|
||||||
if (profileName.isEmpty() || apiUrl.isEmpty() || apiKey.isEmpty() || botToken.isEmpty() || chatId.isEmpty()) {
|
if (profileName.isEmpty() || apiUrl.isEmpty() || apiKey.isEmpty()) {
|
||||||
Toast.makeText(getContext(), "Invalid input, please enter valid strings", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "Invalid input, please enter valid strings", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (useTelegram && botToken.isEmpty()) {
|
||||||
|
Toast.makeText(getContext(), "Please enter a valid Telegram bot token", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (useTelegram && chatId.isEmpty()) {
|
||||||
|
Toast.makeText(getContext(), "Please enter a valid Telegram chat ID", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Check if the user entered valid numbers
|
//Check if the user entered valid numbers
|
||||||
try {
|
try {
|
||||||
timeBetweenQueries = Float.parseFloat(editTimeBetweenQueries.getText().toString());
|
timeBetweenQueries = Float.parseFloat(editTimeBetweenQueries.getText().toString());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue