fix: toggle community category filter
This commit is contained in:
@@ -255,9 +255,10 @@ const switchFeed = (feed: FeedKey) => {
|
||||
}
|
||||
|
||||
const selectCategory = (category: any) => {
|
||||
activeCategoryId.value = category.id
|
||||
if (activeFeed.value === 'topic') {
|
||||
uni.setStorageSync(COMMUNITY_ACTIVE_CATEGORY_KEY, category.id)
|
||||
const categoryId = Number(category.id) || 0
|
||||
activeCategoryId.value = activeCategoryId.value === categoryId ? 0 : categoryId
|
||||
if (activeFeed.value === 'topic' && activeCategoryId.value > 0) {
|
||||
uni.setStorageSync(COMMUNITY_ACTIVE_CATEGORY_KEY, activeCategoryId.value)
|
||||
uni.removeStorageSync(LEGACY_COMMUNITY_ACTIVE_TAG_KEY)
|
||||
} else {
|
||||
uni.removeStorageSync(COMMUNITY_ACTIVE_CATEGORY_KEY)
|
||||
|
||||
Reference in New Issue
Block a user