link icon indicating copy to clipboard operation
link copied to clipboard

Allow users to revisit the links they create

Open statictype opened this issue 3 years ago • 4 comments

A links overview page was introduced here https://github.com/paritytech/link/pull/20 but i removed it from the MVP. I think it might be cleaner to use react-router instead of HeadlessUI tabs, but the layout can be copy-pasted. Maybe we should limit to displaying 15 links, the list can grow fast.

Is there a way to get all the links shortened by an account from contract storage?

statictype avatar Sep 08 '22 17:09 statictype

We should add the author to the even that gets emitted in shorten(). Then we can query for all events and filter by the author. (I'm not sure if this is convenient in PolkadotJS. In EVM this is quite easy). If it is not easy, then I think we should focus on this as a new feature set for ink!

Have you done much with querying all events from a contract from the beginning of time? I know you can do it for a particular block. @statictype

DoubleOTheven avatar Jun 06 '23 23:06 DoubleOTheven

I do not see any user account data stored in the contract so we cannot currently get the user's stored links. We can support this feature if we do an upgrade. I would lean towards relying on events over storage. Plus it will force us to really fine tune that feature in both the front end and contract level

DoubleOTheven avatar Jun 06 '23 23:06 DoubleOTheven

We could also store them in local storage, i think this is how it was meant initially

statictype avatar Jun 07 '23 06:06 statictype

That could work in the short run, but it is not ideal IMO. I think we should upgrade the contract

DoubleOTheven avatar Jun 07 '23 18:06 DoubleOTheven