Browse Source

Fix format errors

Ricardo Maltez 3 years ago
parent
commit
4a6c4aa625
1 changed files with 2 additions and 2 deletions
  1. 2 2
      pioneer/packages/joy-forum/src/ViewThread.tsx

+ 2 - 2
pioneer/packages/joy-forum/src/ViewThread.tsx

@@ -127,7 +127,7 @@ type ViewThreadProps = ApiProps & InnerViewThreadProps & {
 
 const POSTS_THREAD_MAP_CACHE_KEY = 'postsThreadMap';
 
-async function refreshPostsInThreadCache(nextPostId: PostId, api: ApiPromise) {
+async function refreshPostsInThreadCache (nextPostId: PostId, api: ApiPromise) {
   const newId = (id: number | BN) => api.createType('PostId', id);
   const apiCalls: Promise<Post>[] = [];
   let idToFetch = newId(1);
@@ -135,7 +135,7 @@ async function refreshPostsInThreadCache(nextPostId: PostId, api: ApiPromise) {
   let postsToThread = getPostsIdsInThreadCache();
   const nextThreadId = await api.query.forum.nextThreadId() as ThreadId;
 
-  if (postsToThread.size >= Number(nextThreadId.toString())) { // invalid cache
+  if (postsToThread.size >= nextThreadId.toNumber()) { // invalid cache
     postsToThread = new Map<number, number[]>();
   }