MCPcopy Index your code
hub / github.com/CapSoftware/Cap / flushProjectConfig

Function flushProjectConfig

apps/desktop/src/routes/editor/context.ts:796–819  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

794 let hasPendingProjectSave = false;
795
796 const flushProjectConfig = async () => {
797 if (!hasPendingProjectSave && !saveInFlight) return;
798 if (saveInFlight) {
799 if (hasPendingProjectSave) {
800 shouldResave = true;
801 }
802 return;
803 }
804 saveInFlight = true;
805 shouldResave = false;
806 hasPendingProjectSave = false;
807 try {
808 const config = serializeProjectConfiguration(project);
809 await commands.setProjectConfig(config);
810 } catch (error) {
811 console.error("Failed to persist project config", error);
812 } finally {
813 saveInFlight = false;
814 if (shouldResave) {
815 shouldResave = false;
816 void flushProjectConfig();
817 }
818 }
819 };
820
821 const scheduleProjectConfigSave = () => {
822 hasPendingProjectSave = true;

Callers 2

context.tsFile · 0.85

Calls 1

Tested by

no test coverage detected