diff --git a/gui/app/App.tsx b/gui/app/App.tsx
index 1f3c878..2131d29 100644
--- a/gui/app/App.tsx
+++ b/gui/app/App.tsx
@@ -3,6 +3,7 @@
import { Geist, Geist_Mono } from "next/font/google";
import { Menu } from "./components/Sidebar";
import { Bounce, ToastContainer } from "react-toastify";
+import { Suspense } from "react";
const geistSans = Geist({
variable: "--font-geist-sans",
@@ -24,7 +25,9 @@ export const App = ({ children }: APPProps) => {
className={`${geistSans.variable} ${geistMono.variable} antialiased flex h-screen overflow-hidden`}
>
- {children}
+
+ {children}
+
{
- Apple MacBook Pro 17"
+ Apple MacBook Pro 17
Sliver
Laptop
diff --git a/gui/app/components/Sidebar.tsx b/gui/app/components/Sidebar.tsx
index 2aee6a6..3e68081 100644
--- a/gui/app/components/Sidebar.tsx
+++ b/gui/app/components/Sidebar.tsx
@@ -32,7 +32,7 @@ export const Menu = () => {
packsData.map((pack) => {
return (
(null);
const [imageMime, setImageMime] = useState(null);
const [packInfo, setPackInfo] = useState({
@@ -96,7 +94,10 @@ export default function PackNew() {
closeOnClick: true,
draggable: true,
});
- router.push(`/pack/?id=${data.id}`);
+ const ur = new URL(window.location.href);
+ ur.searchParams.set("id", data.id);
+ ur.pathname = "/pack";
+ window.location.href = ur.href;
}
_submit();
diff --git a/src/api/pack.py b/src/api/pack.py
index 4ac03a8..d24871e 100644
--- a/src/api/pack.py
+++ b/src/api/pack.py
@@ -8,6 +8,7 @@ from io import BytesIO
import base64
import json
+
@apiPack.route("/", methods=["GET"])
def getPack(id):
if not os.path.exists(f"{PACKS_FOLDER}/{id}/packfile.json"):
@@ -21,12 +22,15 @@ def getPack(id):
return jsonify(pack)
+
@apiPack.route("//image", methods=["GET"])
def getPackImage(id):
if not os.path.exists(f"{PACKS_FOLDER}/{id}/packicon.png"):
return redirect(url_for("static", filename="defaulticon.png"))
- return send_file(f"{PACKS_FOLDER}/{id}/packicon.png")
+ with open(f"{PACKS_FOLDER}/{id}/packicon.png", mode="rb") as fp:
+ f = BytesIO(fp.read())
+ return send_file(f, mimetype="image/png")
@apiPack.route("//image/edit", methods=["POST"])