fix: change type parameter from array to single value for API compatibility

SDK API only accepts single MessageType value, not array. Updated to use client-side filtering for Tab-based message type filtering (all/notice/other) instead of server-side filtering.

Changes:
- hooks/use-messages.ts: Changed type parameter from array to single value
- app/(tabs)/message.tsx: Replaced getMessageTypeByTab with filterMessagesByTab for client-side filtering
- Removed useEffect dependency on activeTab to prevent unnecessary refetches

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
imeepos
2026-01-21 15:15:47 +08:00
parent 4868ff8660
commit a344410374
7 changed files with 378 additions and 114 deletions

View File

@@ -13,8 +13,8 @@
"@react-navigation/bottom-tabs": "^7.4.0",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.8",
"@repo/core": "1.0.2",
"@repo/sdk": "1.0.7",
"@repo/core": "1.0.3",
"@repo/sdk": "1.0.9",
"@shopify/flash-list": "^2.0.0",
"@stripe/react-stripe-js": "^5.4.1",
"@stripe/stripe-js": "^8.5.3",
@@ -654,9 +654,9 @@
"@react-navigation/routers": ["@react-navigation/routers@7.5.3", "", { "dependencies": { "nanoid": "^3.3.11" } }, "sha512-1tJHg4KKRJuQ1/EvJxatrMef3NZXEPzwUIUZ3n1yJ2t7Q97siwRtbynRpQG9/69ebbtiZ8W3ScOZF/OmhvM4Rg=="],
"@repo/core": ["@repo/core@1.0.2", "https://gitea.bowongai.com/api/packages/bowong/npm/%40repo%2Fcore/-/1.0.2/core-1.0.2.tgz", {}, "sha512-/d1L9I+9u8rHiWBNXW2GC5hB6okd/EoePpcuiJrbbtRH8rZuQOVtdRDuDHIokrL0eFN9rEi3zaoFdvyZgD0hrg=="],
"@repo/core": ["@repo/core@1.0.3", "https://gitea.bowongai.com/api/packages/bowong/npm/%40repo%2Fcore/-/1.0.3/core-1.0.3.tgz", {}, "sha512-lO7rk3hsrtoyewZu7cgwlFqjjhGBx+lw4wxkehfvTsbTWm/tKChq1t6SC+XXNJj/YVwnLp6AH8BOsvR4r1nxyg=="],
"@repo/sdk": ["@repo/sdk@1.0.7", "https://gitea.bowongai.com/api/packages/bowong/npm/%40repo%2Fsdk/-/1.0.7/sdk-1.0.7.tgz", { "dependencies": { "@repo/core": "1.0.2", "reflect-metadata": "^0.2.1", "zod": "^4.2.1" } }, "sha512-KQ8bgj3fA85xFN3X6rVkM19wk5NhXoc3un5jEUn05xBXGmWtDLZ1TgbF1vR1fSz8XBejnxnlb6c9AtqjDthFPw=="],
"@repo/sdk": ["@repo/sdk@1.0.9", "https://gitea.bowongai.com/api/packages/bowong/npm/%40repo%2Fsdk/-/1.0.9/sdk-1.0.9.tgz", { "dependencies": { "@repo/core": "1.0.3", "reflect-metadata": "^0.2.1", "zod": "^4.2.1" } }, "sha512-ayIVmc5tlHZ8BJIowphnTuOaHDr2BwyDfu3HbGbtLjoxrmsvchAS8Dso9PMK2F6Wf7E9iFcDi55empbZUQzcUg=="],
"@rtsao/scc": ["@rtsao/scc@1.1.0", "", {}, "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g=="],