fix unused variable errors
This commit is contained in:
@@ -148,7 +148,7 @@ function StarterPackList({
|
||||
if (isFetchingNextPage || !hasNextPage || isError) return
|
||||
try {
|
||||
await fetchNextPage()
|
||||
} catch (err) {
|
||||
} catch {
|
||||
// Error handling is optional since this is just pagination
|
||||
}
|
||||
}, [isFetchingNextPage, hasNextPage, isError, fetchNextPage])
|
||||
|
||||
@@ -49,7 +49,7 @@ function Inner({}: {control: DialogControlProps}) {
|
||||
token: state.code.trim(),
|
||||
})
|
||||
setStatus('success')
|
||||
} catch (e) {
|
||||
} catch {
|
||||
setStatus('failure')
|
||||
}
|
||||
})()
|
||||
|
||||
@@ -50,7 +50,7 @@ export async function getLinkMeta(
|
||||
// follow redirects for soundcloud shortlinks
|
||||
// QUESTION - do we want to follow redirects in other cases? -sfn
|
||||
shouldFollowRedirect = urlp.hostname === 'on.soundcloud.com'
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return {
|
||||
error: 'Invalid URL',
|
||||
likelyType: LikelyType.Other,
|
||||
@@ -107,7 +107,7 @@ export function getLikelyType(url: URL | string): LikelyType {
|
||||
if (typeof url === 'string') {
|
||||
try {
|
||||
url = new URL(url)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return LikelyType.Other
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ async function checkIsOnline(): Promise<boolean> {
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ export function parseEmbedPlayerFromUrl(
|
||||
let urlp
|
||||
try {
|
||||
urlp = new URL(url)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return undefined
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export function createStarterPackLinkFromAndroidReferrer(
|
||||
if (contentParts.length !== 3) return null
|
||||
|
||||
return `at://${contentParts[1]}/app.bsky.graph.starterpack/${contentParts[2]}`
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export function parseStarterPackUri(uri?: string): {
|
||||
rkey,
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export function toNiceDomain(url: string): string {
|
||||
return 'Bluesky Social'
|
||||
}
|
||||
return urlp.host ? urlp.host : url
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return url
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export function toShortUrl(url: string): string {
|
||||
return urlp.host + path.slice(0, 13) + '...'
|
||||
}
|
||||
return urlp.host + path
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return url
|
||||
}
|
||||
}
|
||||
@@ -364,7 +364,7 @@ export function getHostnameFromUrl(url: string | URL): string | null {
|
||||
let urlp
|
||||
try {
|
||||
urlp = new URL(url)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
return urlp.hostname
|
||||
|
||||
@@ -14,7 +14,7 @@ initPromise.then(() => {
|
||||
if (Statsig.checkGate('enable_bitdrift_v2_networking')) {
|
||||
isNetworkEnabled = true
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Statsig may complain about it being called too early.
|
||||
}
|
||||
if (isEnabled && BITDRIFT_API_KEY) {
|
||||
|
||||
@@ -126,7 +126,7 @@ function Inner({
|
||||
}),
|
||||
),
|
||||
)
|
||||
} catch (error) {
|
||||
} catch {
|
||||
Toast.show(
|
||||
_(
|
||||
msg({
|
||||
|
||||
@@ -48,7 +48,7 @@ export function CaptchaWebView({
|
||||
return
|
||||
}
|
||||
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
|
||||
// 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.
|
||||
|
||||
@@ -55,7 +55,7 @@ export async function write<K extends keyof Schema>(
|
||||
// This is good mostly because it avoids useless broadcasts to other tabs.
|
||||
return
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Ignore and go through the normal path.
|
||||
}
|
||||
_state = normalizeData({
|
||||
@@ -85,7 +85,7 @@ onUpdate satisfies PersistedApi['onUpdate']
|
||||
export async function clearStorage() {
|
||||
try {
|
||||
localStorage.removeItem(BSKY_STORAGE)
|
||||
} catch (e: any) {
|
||||
} catch {
|
||||
// Expected on the web in private mode.
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ function writeToStorage(value: Schema) {
|
||||
if (rawData) {
|
||||
try {
|
||||
localStorage.setItem(BSKY_STORAGE, rawData)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Expected on the web in private mode.
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ function readFromStorage(): Schema | undefined {
|
||||
let rawData: string | null = null
|
||||
try {
|
||||
rawData = localStorage.getItem(BSKY_STORAGE)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// Expected on the web in private mode.
|
||||
}
|
||||
if (rawData) {
|
||||
|
||||
@@ -27,7 +27,8 @@ export function useServiceConfigQuery() {
|
||||
topicsEnabled: Boolean(data.topicsEnabled),
|
||||
liveNow: data.liveNow ?? [],
|
||||
}
|
||||
} catch (e) {
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch service config', err)
|
||||
return {
|
||||
checkEmailConfirmed: false,
|
||||
topicsEnabled: false,
|
||||
|
||||
@@ -91,7 +91,7 @@ export function tenorUrlToBskyGifUrl(tenorUrl: string) {
|
||||
let url
|
||||
try {
|
||||
url = new URL(tenorUrl)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
logger.debug('invalid url passed to tenorUrlToBskyGifUrl()')
|
||||
return ''
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ export function isSessionExpired(account: SessionAccount) {
|
||||
return didExpire
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
} catch {
|
||||
logger.error(`session: could not decode jwt`)
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -17,7 +17,7 @@ export function useWebPreloadEmoji({immediate}: {immediate?: boolean} = {}) {
|
||||
try {
|
||||
const data = (await import('./EmojiPickerData.json')).default
|
||||
init({data})
|
||||
} catch (e) {}
|
||||
} catch {}
|
||||
}, [])
|
||||
if (immediate) preload()
|
||||
return preload
|
||||
|
||||
@@ -322,7 +322,7 @@ let NotificationFeedItem = ({
|
||||
try {
|
||||
const rkey = new AtUri(item.notification.author.viewer.following).rkey
|
||||
followingTimestamp = TID.fromStr(rkey).timestamp()
|
||||
} catch (e) {
|
||||
} catch {
|
||||
// For some reason the following URI was invalid. Default to it not being a follow back.
|
||||
console.error('Invalid following URI')
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ function ComposeBtn() {
|
||||
try {
|
||||
setIsFetchingHandle(true)
|
||||
handle = await fetchHandle(handle)
|
||||
} catch (e) {
|
||||
} catch {
|
||||
handle = undefined
|
||||
} finally {
|
||||
setIsFetchingHandle(false)
|
||||
|
||||
@@ -34,7 +34,7 @@ function useWebQueryParams() {
|
||||
const {state} = e.data
|
||||
const lastRoute = state.routes[state.routes.length - 1]
|
||||
setParams(lastRoute.params)
|
||||
} catch (err) {}
|
||||
} catch {}
|
||||
})
|
||||
}, [navigation, setParams])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user