8000 Fix crash in Safari by nimrossum · Pull Request #737 · git-truck/git-truck · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix crash in Safari #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/components/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,14 @@ export function Providers({ children, data }: ProvidersProps) {
let canceled = false
// Persist options to local storage
if (options) {
requestIdleCallback(() => {
if (canceled) return
if (typeof requestIdleCallback === "function") {
requestIdleCallback(() => {
if (canceled) return
localStorage.setItem(OPTIONS_LOCAL_STORAGE_KEY, JSON.stringify(options))
})
} else {
localStorage.setItem(OPTIONS_LOCAL_STORAGE_KEY, JSON.stringify(options))
})
}
}
return () => {
canceled = true
Expand Down
0