atproto explorer

fix blob show condition

handle.invalid 46b122f4 529a8b21

verified
+24 -26
+24 -26
src/components/json.tsx
··· 135 if (blob.$type === "blob") { 136 return ( 137 <> 138 - <span class="flex gap-x-1"> 139 - <Show when={blob.mimeType.startsWith("image/") && !hide()}> 140 - <img 141 - class="max-h-[16rem] w-fit max-w-[16rem]" 142 - src={`https://${pds()}/xrpc/com.atproto.sync.getBlob?did=${repo}&cid=${blob.ref.$link}`} 143 - /> 144 - </Show> 145 - <Show when={blob.mimeType === "video/mp4" && !hide()}> 146 - <ErrorBoundary fallback={() => <span>Failed to load video</span>}> 147 - <VideoPlayer did={repo} cid={blob.ref.$link} /> 148 - </ErrorBoundary> 149 - </Show> 150 - <Show when={params.rkey}> 151 <span 152 classList={{ 153 "flex items-center justify-between gap-1": true, ··· 166 </button> 167 </Tooltip> 168 </Show> 169 - <Show when={pds()}> 170 - <Tooltip text="Blob on PDS"> 171 - <a 172 - href={`https://${pds()}/xrpc/com.atproto.sync.getBlob?did=${repo}&cid=${blob.ref.$link}`} 173 - target="_blank" 174 - class={`${!hide() ? "-mb-1 -ml-0.5" : ""} flex items-center rounded-lg p-1 hover:bg-neutral-200 active:bg-neutral-300 dark:hover:bg-neutral-700 dark:active:bg-neutral-600`} 175 - > 176 - <span class="iconify lucide--external-link text-base"></span> 177 - </a> 178 - </Tooltip> 179 - </Show> 180 </span> 181 - </Show> 182 - </span> 183 {rawObj} 184 </> 185 );
··· 135 if (blob.$type === "blob") { 136 return ( 137 <> 138 + <Show when={pds() && params.rkey}> 139 + <span class="flex gap-x-1"> 140 + <Show when={blob.mimeType.startsWith("image/") && !hide()}> 141 + <img 142 + class="max-h-[16rem] w-fit max-w-[16rem]" 143 + src={`https://${pds()}/xrpc/com.atproto.sync.getBlob?did=${repo}&cid=${blob.ref.$link}`} 144 + /> 145 + </Show> 146 + <Show when={blob.mimeType === "video/mp4" && !hide()}> 147 + <ErrorBoundary fallback={() => <span>Failed to load video</span>}> 148 + <VideoPlayer did={repo} cid={blob.ref.$link} /> 149 + </ErrorBoundary> 150 + </Show> 151 <span 152 classList={{ 153 "flex items-center justify-between gap-1": true, ··· 166 </button> 167 </Tooltip> 168 </Show> 169 + <Tooltip text="Blob on PDS"> 170 + <a 171 + href={`https://${pds()}/xrpc/com.atproto.sync.getBlob?did=${repo}&cid=${blob.ref.$link}`} 172 + target="_blank" 173 + class={`${!hide() ? "-mb-1 -ml-0.5" : ""} flex items-center rounded-lg p-1 hover:bg-neutral-200 active:bg-neutral-300 dark:hover:bg-neutral-700 dark:active:bg-neutral-600`} 174 + > 175 + <span class="iconify lucide--external-link text-base"></span> 176 + </a> 177 + </Tooltip> 178 </span> 179 + </span> 180 + </Show> 181 {rawObj} 182 </> 183 );