Skip to content

Commit

Permalink
feat: modify getItem
Browse files Browse the repository at this point in the history
  • Loading branch information
answershuto committed Aug 2, 2023
1 parent 4394a5c commit b04ef65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/cache-canvas/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export const CacheCanvas = forwardRef((props: CacheCanvasProps, ref) => {
if (canIUse) {
const res = window.__megability_bridge__.syncCall('userKVStorage', 'getItem', { key: '${cacheKey}' });
if (res && res.statusCode === 0 && res.data) {
base64Data = res.data;
if (res && res.statusCode === 0 && res.data && res.data.result) {
base64Data = res.data.result;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cache-canvas/src/storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const Storage = {

if (canIUse) {
const res = window.__megability_bridge__.syncCall('userKVStorage', 'getItem', { key });
if (res && res.statusCode === 0 && res.data) {
return res.data;
if (res && res.statusCode === 0 && res.data && res.data.result) {
return res.data.result;
}
}
}
Expand Down

0 comments on commit b04ef65

Please sign in to comment.