diff --git a/examples/basic/index.html b/examples/basic/index.html index a356533..b651ef7 100644 --- a/examples/basic/index.html +++ b/examples/basic/index.html @@ -8,7 +8,7 @@ font-family: Helvetica Neue, serif; } - div { + #test-button { background-color: #0000FF; width: 200px; padding: 30px; @@ -26,25 +26,24 @@

Skift: A/B test basic example

This is an A/B split test

Below there's a div. It will be blue originally, and orange if you're in the A/B test.

-
This is the original div
+ diff --git a/src/index.ts b/src/index.ts index 34029c7..14ea947 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,10 +28,8 @@ const ui = uiFactory( $(() => { if (shouldShowUI()) { - return; + ui.show(); } - - setTimeout(() => ui.show(), 1000); }); export { diff --git a/src/main.ts b/src/main.ts index d4fc213..a177516 100644 --- a/src/main.ts +++ b/src/main.ts @@ -138,7 +138,7 @@ export function reset(): void { export function shouldShowUI() { return ( - !_config.globalCondition(userAgentInfo) || - !_config.uiCondition(userAgentInfo) + _config.globalCondition(userAgentInfo) === true && + _config.uiCondition(userAgentInfo) === true ); }