fix: preserve upload progress across page navigation
This commit is contained in:
1 parent
ae8e175376
commit
fa82c99a52
5 files changed
+197
-37
No files matched your search
@@ -14,6 +14,7 @@ import { useTheme } from "./theme";
|
||||
import { Icon } from "./ui/Icon";
|
||||
import { useSpatialNav } from "./ui/nav";
|
||||
import { THEME_ICON, THEME_LABEL } from "./ui/ThemeButton";
|
||||
import { UploadProvider } from "./uploads";
|
||||
|
||||
function RequirePerm({ perm, children }: { perm: string; children: JSX.Element }) {
|
||||
const { can } = useAuth();
|
||||
@@ -86,6 +87,7 @@ export function App() {
|
||||
if (me.must_change_password || me.must_change_username) return <ChangeCredentials forced />;
|
||||
|
||||
return (
|
||||
<UploadProvider key={me.id}>
|
||||
<Routes>
|
||||
<Route path="/play/:versionId" element={<RequirePerm perm="games.play"><Play /></RequirePerm>} />
|
||||
<Route
|
||||
@@ -127,5 +129,6 @@ export function App() {
|
||||
}
|
||||
/>
|
||||
</Routes>
|
||||
</UploadProvider>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user