AOSSIE-Org / AOSSIE-Org/OrgExplorer

Refactor: Centralize localStorage Operations in a Storage Utility

未关闭
#194 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
JavaScript
星标
34
派生
92
平均合并
8 天 7 小时
30 天内合并 PR
12

描述

## Problem

`AppContext.jsx` currently contains direct `localStorage` operations for:

* PAT (`oe_pat`)
* Rate limit (`oe_rate_limit`)
* Recent searches (`oe_recent`)

This couples storage logic with application state and makes it harder to maintain.

## Proposed Solution

Create a reusable storage utility at:

`src/utils/storage.js`

The utility should:

* Centralize `localStorage` access
* Define storage keys using `STORAGE_KEYS`
* Provide `get`, `set`, and `remove` methods

Then update `src/context/AppContext.jsx` to use the storage utility instead of accessing `localStorage` directly.

## Expected Result

* No direct `localStorage` calls in `AppContext.jsx`
* Storage keys have a single source of truth
* Existing PAT, rate-limit, and recent-search behaviour remains unchanged

**Type:** Code Quality Improvement

贡献指南

打开贡献指南

调研方向

Start by reading src/context/AppContext.jsx to locate the PAT, rate-limit, and recent-search localStorage operations, then inspect the surrounding src/utils structure. Use the issue's expected results as the checklist: storage access and keys are centralized in src/utils/storage.js, AppContext.jsx has no direct localStorage calls, and existing behavior remains unchanged.

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
frontend
Issue 类型
重构
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
描述清楚
新手友好度
76/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。