mirror of
https://github.com/linuxserver/composer.git
synced 2026-01-09 07:45:12 +08:00
ensure saved session is loaded after api call
This commit is contained in:
parent
dcaa10325f
commit
b99090fec7
@ -104,6 +104,7 @@ function App() {
|
||||
const [isUploadConfirmOpen, setIsUploadConfirmOpen] = useState(false);
|
||||
const [pendingFile, setPendingFile] = useState(null);
|
||||
const [isDefinitionsLoaded, setIsDefinitionsLoaded] = useState(false);
|
||||
const [isHydrated, setIsHydrated] = useState(false);
|
||||
|
||||
const workspaceContainerRef = useRef(null);
|
||||
const originalItemsRef = useRef([]);
|
||||
@ -297,6 +298,7 @@ function App() {
|
||||
setWorkspaceItems(sessionItems);
|
||||
setConnections(sessionConnections);
|
||||
setTransform(sessionTransform);
|
||||
setIsHydrated(true);
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const github = urlParams.get('github');
|
||||
@ -318,6 +320,7 @@ function App() {
|
||||
}, [isDefinitionsLoaded, loadedItemData, loadFromUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isHydrated) return;
|
||||
if (saveTimeoutRef.current) clearTimeout(saveTimeoutRef.current);
|
||||
saveTimeoutRef.current = setTimeout(() => {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user