Giter Site home page Giter Site logo

Comments (5)

nicklockwood avatar nicklockwood commented on August 16, 2024

The logic above is to check if the shouldPromptForRating function should return NO, in other words:

"if too few uses AND too few events then DO NOT prompt"

This is consistent with the documentation, because the implication here is that if either the uses or the events thresholds are met then then above condition will fail and it will prompt.

from irate.

robotron2084 avatar robotron2084 commented on August 16, 2024

That logic is failing for me because the use count is being met but the events count isn't and it is NOT returning no . The implication it seems to me is that both conditions must be met, and if one is met, but the other isn't, then it will not return NO (sorry about that double negative. My situation:

irate.usesUntilPrompt = 3;
irate.eventsUntilPrompt = 16;

I'll get 3 uses, and 3 events:

if (3 < 3 /* false _/ && 3 < 16 /_true*))
{
// False and true do not equal true, so this will not occur, but I want it to. I do not want to show the prompt just yet.
}

I'm rushing out the door to get my wisdom teeth removed, so I hope I got this right. I won't be able to reply until the meds wear off. :D

Thanks for your fast reply!

from irate.

nicklockwood avatar nicklockwood commented on August 16, 2024

Yes, so (using your example) the documentation says that the prompt will show if 3 < 3 or 3 < 16, and that's what's happening. What you are now saying is that you only want it to show if 3 < 3 and 3 < 16, contrary to the documentation.

Arguably I guess that may be more useful, so I might consider changing this behaviour, but it's technically correct as documented.

To override the prompt logic, without modifying the library (which is a bad idea for future compatibility), you can implement the iRateDelegate and supply your own logic in the iRate:shouldPromptForRating: delegate method.

from irate.

nicklockwood avatar nicklockwood commented on August 16, 2024

I looked into changing the way it works, but it would be too likely to introduce bugs in existing projects due to the defaults. Since both useCount and eventCount default to 10, and both are optional, if I made them mandatory, users would have to remember to set eventCount to zero if they weren't using it, otherwise the rating would never appear. I think it's best just to leave it as it is.

from irate.

robotron2084 avatar robotron2084 commented on August 16, 2024

Hi Nick,

Thanks for looking into this but you're correct to leave it as it is, and the documentation is correct. I was confused by the double negative, sorry about that! I do think that i will hack my copy tho to be OR instead of AND because for my purposes it makes more sense.

Thanks again,
C

from irate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.