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