Skip to content

Commit

Permalink
fix minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipthelen committed Jun 25, 2024
1 parent f94f359 commit 199c929
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class MainNotificationsManager : NotificationsManager {
Notification.Type.ACHIEVEMENT_GENERIC.type -> true
Notification.Type.ACHIEVEMENT_ONBOARDING_COMPLETE.type -> true
Notification.Type.LOGIN_INCENTIVE.type -> true
Notification.Type.NEW_MYSTERY_ITEMS.type -> true
Notification.Type.FIRST_DROP.type -> true
else -> false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ open class ShopItem : RealmObject(), BaseObject {
val isTypeItem: Boolean
get() = "eggs" == purchaseType || "hatchingPotions" == purchaseType || "food" == purchaseType || "armoire" == purchaseType || "potion" == purchaseType || "debuffPotion" == purchaseType || "fortify" == purchaseType

val isTypeSpecial: Boolean
get() = "special" == purchaseType

val isTypeBundle: Boolean
get() = "bundles" == purchaseType

val isTypeQuest: Boolean
get() = "quests" == purchaseType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class ComposeAvatarEquipmentFragment :
inventoryRepository.equip(
if (userViewModel.user.value?.preferences?.costume == true) "costume" else "equipped",
activeEquipment ?: "")
} else {
} else if (equipment.key?.contains("base_0") == false) {
inventoryRepository.equip(
if (userViewModel.user.value?.preferences?.costume == true) "costume" else "equipped",
equipment.key ?: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class PurchaseDialog(

val contentView: PurchaseDialogContent
when {
shopItem.isTypeItem -> contentView = PurchaseDialogItemContent(context)
shopItem.isTypeItem || shopItem.isTypeSpecial || shopItem.isTypeBundle -> contentView = PurchaseDialogItemContent(context)
shopItem.isTypeQuest -> {
contentView = PurchaseDialogQuestContent(context)
MainScope().launch(ExceptionHandler.coroutine()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ object MarkdownParser {
private fun processMarkdown(input: String): String {
var processedInput = preprocessMarkdownLinks(input)
processedInput = preprocessImageMarkdown(processedInput)
processedInput = preprocessHtmlTags(processedInput)
return processedInput
}

Expand Down Expand Up @@ -154,7 +155,7 @@ object MarkdownParser {
while (matcher.find()) {
val linkText = matcher.group(1)
val url = matcher.group(2)
val sanitizedUrl = url.replace(Regex("\\s"), "")
val sanitizedUrl = url?.replace(Regex("\\s"), "")
val correctedLink = "[$linkText]($sanitizedUrl)"
matcher.appendReplacement(sb, Matcher.quoteReplacement(correctedLink))
}
Expand All @@ -163,6 +164,13 @@ object MarkdownParser {
return sb.toString()
}

val brRegex = Regex("<br>")
private fun preprocessHtmlTags(markdown: String): String {
return markdown.replace(brRegex) {
"\n"
}
}

fun parseMarkdownAsync(
input: String?,
onSuccess: (Spanned) -> Unit,
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NAME=4.4
CODE=7961
CODE=7981

0 comments on commit 199c929

Please sign in to comment.