Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shahroz16 committed Sep 5, 2024
1 parent 964ca3d commit 29451b4
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 19 deletions.
11 changes: 0 additions & 11 deletions messaginginapp/api/messaginginapp.api
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,6 @@ public final class io/customer/messaginginapp/state/InAppMessagingAction$EmbedMe
public abstract class io/customer/messaginginapp/state/InAppMessagingAction$EngineAction {
}

public final class io/customer/messaginginapp/state/InAppMessagingAction$EngineAction$Error : io/customer/messaginginapp/state/InAppMessagingAction {
public fun <init> (Lio/customer/messaginginapp/gist/data/model/Message;)V
public final fun component1 ()Lio/customer/messaginginapp/gist/data/model/Message;
public final fun copy (Lio/customer/messaginginapp/gist/data/model/Message;)Lio/customer/messaginginapp/state/InAppMessagingAction$EngineAction$Error;
public static synthetic fun copy$default (Lio/customer/messaginginapp/state/InAppMessagingAction$EngineAction$Error;Lio/customer/messaginginapp/gist/data/model/Message;ILjava/lang/Object;)Lio/customer/messaginginapp/state/InAppMessagingAction$EngineAction$Error;
public fun equals (Ljava/lang/Object;)Z
public final fun getMessage ()Lio/customer/messaginginapp/gist/data/model/Message;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class io/customer/messaginginapp/state/InAppMessagingAction$EngineAction$MessageLoadingFailed : io/customer/messaginginapp/state/InAppMessagingAction {
public fun <init> (Lio/customer/messaginginapp/gist/data/model/Message;)V
public final fun component1 ()Lio/customer/messaginginapp/gist/data/model/Message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class GistSdk(
state.event == Lifecycle.Event.ON_RESUME || state.event == Lifecycle.Event.ON_PAUSE
}
.filter { state ->
// ignore events from GistModalActivity to prevent polling/stopping polling when the in-app is displayed
state.activity.get() != null && state.activity.get() !is GistModalActivity
}
.collect { state ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ internal class EngineWebView @JvmOverloads constructor(
fun onLifecycleResumed() {
logger.info("EngineWebView onLifecycleResumed")

Check warning on line 61 in messaginginapp/src/main/java/io/customer/messaginginapp/gist/presentation/engine/EngineWebView.kt

View check run for this annotation

Codecov / codecov/patch

messaginginapp/src/main/java/io/customer/messaginginapp/gist/presentation/engine/EngineWebView.kt#L61

Added line #L61 was not covered by tests
webView?.let { engineWebViewInterface.attach(webView = it) }
super.onAttachedToWindow()
}

@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
fun onLifecyclePaused() {
logger.info("EngineWebView onLifecyclePaused")

Check warning on line 67 in messaginginapp/src/main/java/io/customer/messaginginapp/gist/presentation/engine/EngineWebView.kt

View check run for this annotation

Codecov / codecov/patch

messaginginapp/src/main/java/io/customer/messaginginapp/gist/presentation/engine/EngineWebView.kt#L67

Added line #L67 was not covered by tests
webView?.let { engineWebViewInterface.detach(webView = it) }
super.onDetachedFromWindow()
}

fun stopLoading() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ sealed class InAppMessagingAction {
sealed class EngineAction {
data class Tap(val message: Message, val route: String, val name: String, val action: String) : InAppMessagingAction()
data class MessageLoadingFailed(val message: Message) : InAppMessagingAction()
data class Error(val message: Message) : InAppMessagingAction()
}

object ClearMessageQueue : InAppMessagingAction()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ internal fun gistListenerMiddleware(gistListener: GistListener?) = middleware<In
gistListener?.onError(action.message)
}

is InAppMessagingAction.EngineAction.Error -> {
gistListener?.onError(action.message)
}

is InAppMessagingAction.EngineAction.Tap -> {
gistListener?.onAction(action.message, action.route, action.action, action.name)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ class InAppMessagingStoreTest : IntegrationTest() {
initializeAndSetUser()
val message = Message(queueId = "1")

manager.dispatch(InAppMessagingAction.EngineAction.Error(message))
manager.dispatch(InAppMessagingAction.EngineAction.MessageLoadingFailed(message))

verify { inAppEventListener.errorWithMessage(InAppMessage.getFromGistMessage(message)) }
}
Expand Down

0 comments on commit 29451b4

Please sign in to comment.