Skip to content

Comments

Sort Alphabitically by Name#124

Open
kareemhb wants to merge 1 commit intogbraad-apps:masterfrom
kareemhb:patch-1
Open

Sort Alphabitically by Name#124
kareemhb wants to merge 1 commit intogbraad-apps:masterfrom
kareemhb:patch-1

Conversation

@kareemhb
Copy link

@kareemhb kareemhb commented Sep 20, 2023

I find it hard to go through the list of OTPs to find the one I am after. I added a few lines of code to sort them alphabitically by name.

I find it hard to go through the list of OTPs to find the one I am after. I added a line of code to sort them alphabitically be name.
@kareemhb kareemhb changed the title Sort Alphabitically be Name Sort Alphabitically by Name Sep 20, 2023
@bonifacio123
Copy link

Hello, I cloned and merged locally but this sort feature doesn't seem to be working for me on a desktop not phone. Listed OTP's are unsorted. The other static header commit works great. What I did was apply your patch and reload the page in the browser. I also confirmed that the patch was there with a view-source. Thank you.

@kareemhb
Copy link
Author

kareemhb commented Sep 21, 2023

@bonifacio123 It doesn't work on fetching the accounts object. It works on building it.

Getting the sort function to work on fetching the accounts object would unnecessarily run additional functions on page load. Instead, the sort function runs everytime a new key is added and stores a sorted object to be fetched (load-free) on page load.

When a new key is added, it sorts the object and adds the new key where it belongs in the object. At the moment, it simply appends new keys to the end of the object.

Try to add any random key and your keys will get sorted. you only do that once because you've already got keys stored in your localStorage before the update. For anyone installing Gauth for the first time they would have the keys sorted by default.

@bonifacio123
Copy link

Works as you described. Thank you

@gbraad-apps gbraad-apps locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants