From 3cd73255711be4b43998254c93013d2bf95ca323 Mon Sep 17 00:00:00 2001 From: AdamGrzybkowski Date: Mon, 6 Mar 2017 09:27:45 +0100 Subject: [PATCH] Bug fixing --- app/src/main/java/com/adamg/hnreader/adapter/ItemsAdapter.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/adamg/hnreader/adapter/ItemsAdapter.kt b/app/src/main/java/com/adamg/hnreader/adapter/ItemsAdapter.kt index 9a538c3..40a8af2 100644 --- a/app/src/main/java/com/adamg/hnreader/adapter/ItemsAdapter.kt +++ b/app/src/main/java/com/adamg/hnreader/adapter/ItemsAdapter.kt @@ -48,11 +48,11 @@ class ItemsAdapter(var context: Context, var stories: List): RecyclerView. var intent = Intent(context, StoryActivity::class.java) intent.putExtra(AppConstants.ITEM, story) context.startActivity(intent) - } else if (story.type == Type.ASK || story.type == Type.LINK && story.domain == null || story.domain == null) { + } else if ((story.type == Type.ASK || story.type == Type.LINK) && story.domain == null || story.domain == null) { var intent = Intent(context, AskActivity::class.java) intent.putExtra(AppConstants.ITEM, Ask.fromItem(story)) context.startActivity(intent) - } else if (story.type == Type.JOB) { + } else if ( (story.type == Type.JOB || story.type == Type.ASK) && story.domain != null) { var intent = Intent(context, JobActivity::class.java) intent.putExtra(AppConstants.ITEM, Job.fromItem(story)) context.startActivity(intent)