Files
MajoorWaldi-ComfyUI-Majoor-…/ui/stores/getOptionalRuntimeStore.ts
T

12 lines
272 B
TypeScript

import { getActivePinia } from "pinia";
import { useRuntimeStore } from "./useRuntimeStore.js";
export function getOptionalRuntimeStore() {
try {
if (!getActivePinia()) return null;
return useRuntimeStore();
} catch {
return null;
}
}