kiriDevs / vplanweb

A web app for the substitution plan of my school - data is supplied by an API maintained by @ChuangSheep
https://vplan.kiridevs.live
3 stars 0 forks source link

"Ignore subjects filter" stays on after turning of "Only display relevant entries" and switching to settings #76

Closed kiriDevs closed 1 year ago

kiriDevs commented 2 years ago

When you quickly switch to settings after disabling "only display relevant entries", "Ignore subjects filter" stays on, resulting in bugged highlighting behaviour after returning to the viewer from settings (partial matches displayed as full matches).

kiriDevs commented 2 years ago

I think I figured out the cause of this.

When the "only show relevant subjects" (filter switch 1) is disabled, "ignore subject filter" (filter switch 2) is automatically disabled. However, this automatic change is not saved to localStorage, meaning filter.ignoreSubjects is loaded as true again on the next occasion, which entering and leaving settings is, as entering settings will fully un-mount the <HomeScreen /> component, meaning localStorage is re-read on the next mount.