Skip to content

Commit

Permalink
Merge pull request #246 from node-real/fix/mainnet-bucket-meta-field-…
Browse files Browse the repository at this point in the history
…type

fix: primary id type compare
  • Loading branch information
aiden-cao authored Nov 3, 2023
2 parents e59e0e9 + bb0d0b4 commit a43d099
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/dcellar-web-ui/src/store/slices/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const setupBuckets =

const bucketSpInfo = bucketList.map((b) => ({
bucketName: b.BucketInfo.BucketName,
sp: find<SpItem>(allSps, (sp) => sp.id === b.Vgf.PrimarySpId)!,
sp: find<SpItem>(allSps, (sp) => String(sp.id) === String(b.Vgf.PrimarySpId))!,
}));

dispatch(setPrimarySpInfos(bucketSpInfo));
Expand Down
4 changes: 2 additions & 2 deletions apps/dcellar-web-ui/src/store/slices/sp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const spSlice = createSlice({

export const selectBucketSp = (bucket: AllBucketInfo) => (state: RootState) => {
const { allSps } = state.sp;
return find<SpItem>(allSps, (sp) => sp.id === bucket.Vgf.PrimarySpId);
return find<SpItem>(allSps, (sp) => String(sp.id) === String(bucket.Vgf.PrimarySpId));
};

export const { setStorageProviders, setPrimarySpInfo, setPrimarySpInfos, updateSps, setSpMeta } =
Expand Down Expand Up @@ -147,7 +147,7 @@ export const getPrimarySpInfo =
const [data, error] = await getVirtualGroupFamily({ familyId });
if (error) return null;
const sp = allSps.find(
(item) => item.id === data?.globalVirtualGroupFamily?.primarySpId,
(item) => String(item.id) === String(data?.globalVirtualGroupFamily?.primarySpId),
) as SpItem;
if (!sp) return null;
dispatch(setPrimarySpInfo({ bucketName, sp }));
Expand Down

0 comments on commit a43d099

Please sign in to comment.