Fixed Web of Trust Minimum Follower Count Setting Not Persisting
Summary:
-
We identified that the “Web of Trust” slider’s value was not updating as expected because it was implemented as an uncontrolled component using the defaultValue prop. This caused the slider to retain the initial default of 3 even after a change, and upon refresh the initialization function (getLocalStorageData) reverted the value to the default when a stored value was not properly detected.
-
To address this for the current session, we refactored the slider as a controlled component (using the value prop) and removed the “Refresh to Apply” button so that changes update immediately and persist within the session.
Note: However, on a full page refresh, the slider still resets to the default value, indicating that further investigation into the persistence mechanism in getLocalStorageData is needed for cross-session retention.
References : Closes #120
@calvadev , Can you please review this approach and tell me if this fix is okay because i tried couple of ways to solve this with tweaks to already implemented logic but value changes to default value of 3 after each refresh (and we have kept refresh to apply button for the updation of new wot value( and thus it is not updated). seems like it starts a new session after reloading just like we see in nostr-profile section where we need to add a passphrase to keep current session going on (atleast when we are browsing).
@calvadev any Pov on this one ?
@GautamBytes If the WoT score still doesn't persist, then it's most likely an issue with how either the state variable is being handled upon load or how the value is being fetched from local storage. On my end it seems to work consistently, so it could also be an issue with not waiting on the follower lists to be fetched before modifying.