Skip to content

Commit

Permalink
InputSuggestコンポーネントでのボタン表示条件を修正し、nextPostJsonのキャッシュキーの日付を更新
Browse files Browse the repository at this point in the history
  • Loading branch information
yuiseki committed Nov 9, 2024
1 parent 660b9fb commit 76f6787
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions src/components/InputSuggest/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,21 @@ export const InputSuggest: React.FC<{

return (
<div className={styles.inputSuggestWrap}>
<div className={styles.inputSuggestButtonsWrap}>
<SuggestByCurrentLocationButton
onClick={() => {
setSuggestMode("location");
}}
onChange={onChangeSuggestByCurrentLocation}
/>
<SuggestByTrendButton
onClick={() => {
setSuggestMode("trend");
}}
/>
</div>
{!coordinates && (
<div className={styles.inputSuggestButtonsWrap}>
<SuggestByCurrentLocationButton
onClick={() => {
setSuggestMode("location");
}}
onChange={onChangeSuggestByCurrentLocation}
/>
<SuggestByTrendButton
onClick={() => {
setSuggestMode("trend");
}}
/>
</div>
)}
{suggestMode === "location" && (
<SuggestByCurrentLocation
coordinates={coordinates}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/nextPostJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const nextPostJsonWithCache = async (
const md5 = new Md5();
md5.appendStr(`${url}\n${bodyJsonString}`);
const hash = md5.end();
const key = `trident-cache_2024-11-07_013_${hash}`;
const key = `trident-cache_2024-11-09_001_${hash}`;
const unixtime = Math.floor(new Date().getTime() / 1000);

const fetchAndCache = async () => {
Expand Down

0 comments on commit 76f6787

Please sign in to comment.