Don't show last update time if there is no value

This commit is contained in:
xynngh 2020-05-16 18:11:42 +04:00
parent 29e43fec3c
commit 7a59f59e6a
1 changed files with 7 additions and 2 deletions

View File

@ -125,8 +125,8 @@ public class DebugActivity extends AppCompatActivity {
sb.append("Base version: ").append(communityDatabase.getBaseDbVersion());
sb.append(" (SIA: ").append(communityDatabase.getSiaAppVersion()).append(")\n");
sb.append("Effective version: ").append(communityDatabase.getEffectiveDbVersion()).append('\n');
sb.append("Last update time: ").append(new Date(App.getSettings().getLastUpdateTime())).append('\n');
sb.append("Last update check time: ").append(new Date(App.getSettings().getLastUpdateCheckTime())).append('\n');
sb.append("Last update time: ").append(dateOrNever(App.getSettings().getLastUpdateTime())).append('\n');
sb.append("Last update check time: ").append(dateOrNever(App.getSettings().getLastUpdateCheckTime())).append('\n');
FeaturedDatabase featuredDatabase = DatabaseSingleton.getFeaturedDatabase();
@ -137,6 +137,11 @@ public class DebugActivity extends AppCompatActivity {
return sb.toString();
}
private String dateOrNever(long time) {
if (time > 0) return new Date(time).toString();
return "never";
}
@Override
protected void onPostExecute(String info) {
setResult(info);