Automatic deployment of PR to test server #4
@ -17,7 +17,7 @@ function App() {
|
||||
|
||||
useEffect(() => {
|
||||
const controller = new AbortController();
|
||||
document.startViewTransition(() => {
|
||||
withViewTransition(() => {
|
||||
return client
|
||||
.GET("/profile", { signal: controller.signal })
|
||||
.then(({ data, response }) => {
|
||||
@ -70,4 +70,9 @@ function splashScreen(extraContent: string) {
|
||||
);
|
||||
}
|
||||
|
||||
function withViewTransition(f: () => Promise<unknown>): void {
|
||||
if (document.startViewTransition) void document.startViewTransition(f);
|
||||
else void f();
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user