Skip to main content

December 10

Hi all, hope you're doing well. I'm happy to be back to bi-weekly updates, I'm going to try and keep to that from now on.

Modal refactoring

The logic for various modals was still partially contained within other classes (e.g. ProfileListenerManager), which wasn't a very neat way of structuring them. It also made the code less maintainable, since some of the modals require specific attributes to be set which work as parameters, and without a common way to invoke the modals each class calling them had to be updated separately if the modal changed.

I've moved the logic for each modal into its own class in the /js/common/modals folder, with each one having an openModal method that sets the necessary attributes for that modal and brings it up for the user, to bring some consistent structure to them in the codebase.

A couple of modals, like those for reports and adding an artwork album, were still being used as HTML templates and created when needed. Conceptually, this reduced the overall SPA loading time, but in practice that isn't going to be significant, and made the frontend code a bit harder to maintain if modals were initialised in different classes depending on need. The modals which don't have any dynamic loading requirements (i.e. those that have no prefixes or IDs in their DOM elements that are created when the modal is created) have been moved into the head imports files.

Notifications

The main notifications details page has been improved, as I hadn't yet properly formatted it or made it work with the NSFW gallery placeholder system, both of which are now mostly done with some additional formatting still to do.

I'm still figuring out the best way to handle getting user notifications from the database, particularly grouped ones. It's been a bit of a mind twister thinking of the best way to ensure that notifications are grouped properly, that old notifications aren't grouped with new ones, etc; I think I've found the right way to approach it, so once I've finalised that in my head it should be finished fairly quickly.

Two factor auth improvements

Users are now given six 2FA recovery codes instead of two, with 2FA needing to be manually disabled by the user after using one if they cannot recover their 2FA device. If the user uses their final active recovery code to log in, their 2FA is disabled, and they are directed to the account settings page from the login screen, showing a warning that they have no more recovery codes and that their 2FA has been disabled.

User Profile listener changes

Initialisation of various listeners for user profile elements has been changed to ensure they are only ever initialised once (for each user profile page instance). In the process of refactoring the code to remove some redundant initialisation checks, I also fixed some bugs that caused some button listeners to not be initialised on user profile pages beyond the first one.

Misc / Bug Fixes

  • Fixed a bug causing the default gradient image banner not to show on user profiles.

  • Fixed two-factor authentication not showing the user's email and "Deserted Chateau" correctly in authenticator apps.

  • Fixed the "no more results" display on infinite scroll galleries appearing before it was supposed to, in the second-last gallery load.

  • Fixed an obscure bug causing some gallery loads to fail if the requesting user had any blocked/hidden users, due to a lack of sequential numeric keys in the resulting array causing it to be interpreted as an object by PHP's json_encode function.

  • The user profile "About" subpage has been implemented. It's functionally identical to the commission info subpage at present.