Basic scaffolding of the frontend #2
@ -17,7 +17,7 @@ function App() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
document.startViewTransition(() => {
|
withViewTransition(() => {
|
||||||
return client
|
return client
|
||||||
.GET("/profile", { signal: controller.signal })
|
.GET("/profile", { signal: controller.signal })
|
||||||
.then(({ data, response }) => {
|
.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;
|
export default App;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user