Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Signature tooltip #373

Closed NikolaiYurchenko closed 1 year ago

NikolaiYurchenko commented 1 year ago

https://github.com/Fujicracy/fuji-v2/issues/370

ferostabio commented 1 year ago

@NikolaiYurchenko I tried to borrow and the tooltip didn't show up and realized you made a mistake.

You shouldn't use the needsAllowance function, that's not what we're trying to know. Use borrow.store's needsSignature property instead. They're two completely separate things.

Actually you'll have to simplify the code. Remove needsAllowance function and replace with the needsSignaure prop.

NikolaiYurchenko commented 1 year ago

that was my first sollution but seems like we additionally call sdk on every input change because we arent doing this now i believe. I'll work on this more

ferostabio commented 1 year ago

that was my first sollution but seems like we additionally call sdk on every input change because we arent doing this now i believe. I'll work on this more

Yes, we are because in order to know the operation type we need to check the user's input in real-time. Let me give you an example:

All of the above change the operation type and so we make a lot of calls to know if the user needs to sign the thing or not. Now, if we're still making too many calls and we can improve, great.