fix unused variable errors

This commit is contained in:
Samuel Newman
2025-10-08 17:07:18 +03:00
parent 6bbdffbd9a
commit a25ce54618
18 changed files with 26 additions and 25 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ function StarterPackList({
if (isFetchingNextPage || !hasNextPage || isError) return if (isFetchingNextPage || !hasNextPage || isError) return
try { try {
await fetchNextPage() await fetchNextPage()
} catch (err) { } catch {
// Error handling is optional since this is just pagination // Error handling is optional since this is just pagination
} }
}, [isFetchingNextPage, hasNextPage, isError, fetchNextPage]) }, [isFetchingNextPage, hasNextPage, isError, fetchNextPage])
@@ -49,7 +49,7 @@ function Inner({}: {control: DialogControlProps}) {
token: state.code.trim(), token: state.code.trim(),
}) })
setStatus('success') setStatus('success')
} catch (e) { } catch {
setStatus('failure') setStatus('failure')
} }
})() })()
+2 -2
View File
@@ -50,7 +50,7 @@ export async function getLinkMeta(
// follow redirects for soundcloud shortlinks // follow redirects for soundcloud shortlinks
// QUESTION - do we want to follow redirects in other cases? -sfn // QUESTION - do we want to follow redirects in other cases? -sfn
shouldFollowRedirect = urlp.hostname === 'on.soundcloud.com' shouldFollowRedirect = urlp.hostname === 'on.soundcloud.com'
} catch (e) { } catch {
return { return {
error: 'Invalid URL', error: 'Invalid URL',
likelyType: LikelyType.Other, likelyType: LikelyType.Other,
@@ -107,7 +107,7 @@ export function getLikelyType(url: URL | string): LikelyType {
if (typeof url === 'string') { if (typeof url === 'string') {
try { try {
url = new URL(url) url = new URL(url)
} catch (e) { } catch {
return LikelyType.Other return LikelyType.Other
} }
} }
+1 -1
View File
@@ -32,7 +32,7 @@ async function checkIsOnline(): Promise<boolean> {
} else { } else {
return false return false
} }
} catch (e) { } catch {
return false return false
} }
} }
+1 -1
View File
@@ -81,7 +81,7 @@ export function parseEmbedPlayerFromUrl(
let urlp let urlp
try { try {
urlp = new URL(url) urlp = new URL(url)
} catch (e) { } catch {
return undefined return undefined
} }
+2 -2
View File
@@ -21,7 +21,7 @@ export function createStarterPackLinkFromAndroidReferrer(
if (contentParts.length !== 3) return null if (contentParts.length !== 3) return null
return `at://${contentParts[1]}/app.bsky.graph.starterpack/${contentParts[2]}` return `at://${contentParts[1]}/app.bsky.graph.starterpack/${contentParts[2]}`
} catch (e) { } catch {
return null return null
} }
} }
@@ -56,7 +56,7 @@ export function parseStarterPackUri(uri?: string): {
rkey, rkey,
} }
} }
} catch (e) { } catch {
return null return null
} }
} }
+3 -3
View File
@@ -55,7 +55,7 @@ export function toNiceDomain(url: string): string {
return 'Bluesky Social' return 'Bluesky Social'
} }
return urlp.host ? urlp.host : url return urlp.host ? urlp.host : url
} catch (e) { } catch {
return url return url
} }
} }
@@ -72,7 +72,7 @@ export function toShortUrl(url: string): string {
return urlp.host + path.slice(0, 13) + '...' return urlp.host + path.slice(0, 13) + '...'
} }
return urlp.host + path return urlp.host + path
} catch (e) { } catch {
return url return url
} }
} }
@@ -364,7 +364,7 @@ export function getHostnameFromUrl(url: string | URL): string | null {
let urlp let urlp
try { try {
urlp = new URL(url) urlp = new URL(url)
} catch (e) { } catch {
return null return null
} }
return urlp.hostname return urlp.hostname
+1 -1
View File
@@ -14,7 +14,7 @@ initPromise.then(() => {
if (Statsig.checkGate('enable_bitdrift_v2_networking')) { if (Statsig.checkGate('enable_bitdrift_v2_networking')) {
isNetworkEnabled = true isNetworkEnabled = true
} }
} catch (e) { } catch {
// Statsig may complain about it being called too early. // Statsig may complain about it being called too early.
} }
if (isEnabled && BITDRIFT_API_KEY) { if (isEnabled && BITDRIFT_API_KEY) {
+1 -1
View File
@@ -126,7 +126,7 @@ function Inner({
}), }),
), ),
) )
} catch (error) { } catch {
Toast.show( Toast.show(
_( _(
msg({ msg({
@@ -48,7 +48,7 @@ export function CaptchaWebView({
return return
} }
onSuccess(code) onSuccess(code)
} catch (e: unknown) { } catch {
// We don't actually want to record an error here, because this will happen quite a bit. We will only be able to // We don't actually want to record an error here, because this will happen quite a bit. We will only be able to
// get hte href of the iframe if it's on our domain, so all the hcaptcha requests will throw here, although it's // get hte href of the iframe if it's on our domain, so all the hcaptcha requests will throw here, although it's
// harmless. Our other indicators of time-to-complete and back press should be more reliable in catching issues. // harmless. Our other indicators of time-to-complete and back press should be more reliable in catching issues.
+4 -4
View File
@@ -55,7 +55,7 @@ export async function write<K extends keyof Schema>(
// This is good mostly because it avoids useless broadcasts to other tabs. // This is good mostly because it avoids useless broadcasts to other tabs.
return return
} }
} catch (e) { } catch {
// Ignore and go through the normal path. // Ignore and go through the normal path.
} }
_state = normalizeData({ _state = normalizeData({
@@ -85,7 +85,7 @@ onUpdate satisfies PersistedApi['onUpdate']
export async function clearStorage() { export async function clearStorage() {
try { try {
localStorage.removeItem(BSKY_STORAGE) localStorage.removeItem(BSKY_STORAGE)
} catch (e: any) { } catch {
// Expected on the web in private mode. // Expected on the web in private mode.
} }
} }
@@ -133,7 +133,7 @@ function writeToStorage(value: Schema) {
if (rawData) { if (rawData) {
try { try {
localStorage.setItem(BSKY_STORAGE, rawData) localStorage.setItem(BSKY_STORAGE, rawData)
} catch (e) { } catch {
// Expected on the web in private mode. // Expected on the web in private mode.
} }
} }
@@ -145,7 +145,7 @@ function readFromStorage(): Schema | undefined {
let rawData: string | null = null let rawData: string | null = null
try { try {
rawData = localStorage.getItem(BSKY_STORAGE) rawData = localStorage.getItem(BSKY_STORAGE)
} catch (e) { } catch {
// Expected on the web in private mode. // Expected on the web in private mode.
} }
if (rawData) { if (rawData) {
+2 -1
View File
@@ -27,7 +27,8 @@ export function useServiceConfigQuery() {
topicsEnabled: Boolean(data.topicsEnabled), topicsEnabled: Boolean(data.topicsEnabled),
liveNow: data.liveNow ?? [], liveNow: data.liveNow ?? [],
} }
} catch (e) { } catch (err) {
console.error('Failed to fetch service config', err)
return { return {
checkEmailConfirmed: false, checkEmailConfirmed: false,
topicsEnabled: false, topicsEnabled: false,
+1 -1
View File
@@ -91,7 +91,7 @@ export function tenorUrlToBskyGifUrl(tenorUrl: string) {
let url let url
try { try {
url = new URL(tenorUrl) url = new URL(tenorUrl)
} catch (e) { } catch {
logger.debug('invalid url passed to tenorUrlToBskyGifUrl()') logger.debug('invalid url passed to tenorUrlToBskyGifUrl()')
return '' return ''
} }
+1 -1
View File
@@ -30,7 +30,7 @@ export function isSessionExpired(account: SessionAccount) {
return didExpire return didExpire
} }
} }
} catch (e) { } catch {
logger.error(`session: could not decode jwt`) logger.error(`session: could not decode jwt`)
} }
return true return true
@@ -17,7 +17,7 @@ export function useWebPreloadEmoji({immediate}: {immediate?: boolean} = {}) {
try { try {
const data = (await import('./EmojiPickerData.json')).default const data = (await import('./EmojiPickerData.json')).default
init({data}) init({data})
} catch (e) {} } catch {}
}, []) }, [])
if (immediate) preload() if (immediate) preload()
return preload return preload
@@ -322,7 +322,7 @@ let NotificationFeedItem = ({
try { try {
const rkey = new AtUri(item.notification.author.viewer.following).rkey const rkey = new AtUri(item.notification.author.viewer.following).rkey
followingTimestamp = TID.fromStr(rkey).timestamp() followingTimestamp = TID.fromStr(rkey).timestamp()
} catch (e) { } catch {
// For some reason the following URI was invalid. Default to it not being a follow back. // For some reason the following URI was invalid. Default to it not being a follow back.
console.error('Invalid following URI') console.error('Invalid following URI')
} }
+1 -1
View File
@@ -539,7 +539,7 @@ function ComposeBtn() {
try { try {
setIsFetchingHandle(true) setIsFetchingHandle(true)
handle = await fetchHandle(handle) handle = await fetchHandle(handle)
} catch (e) { } catch {
handle = undefined handle = undefined
} finally { } finally {
setIsFetchingHandle(false) setIsFetchingHandle(false)
+1 -1
View File
@@ -34,7 +34,7 @@ function useWebQueryParams() {
const {state} = e.data const {state} = e.data
const lastRoute = state.routes[state.routes.length - 1] const lastRoute = state.routes[state.routes.length - 1]
setParams(lastRoute.params) setParams(lastRoute.params)
} catch (err) {} } catch {}
}) })
}, [navigation, setParams]) }, [navigation, setParams])