修复保存草稿的时候,自定义颜色出现两个的问题。
This commit is contained in:
		@@ -88,6 +88,7 @@ export function M3DynamicSchemeBuilder({ scheme, onBuildCompleted }: M3DynamicSc
 | 
				
			|||||||
        prev.schemeStorage.source = collectedSource;
 | 
					        prev.schemeStorage.source = collectedSource;
 | 
				
			||||||
        return prev;
 | 
					        return prev;
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					      setNewColors([]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      showToast(NotificationType.SUCCESS, 'Scheme draft saved!', 'tabler:device-floppy', 3000);
 | 
					      showToast(NotificationType.SUCCESS, 'Scheme draft saved!', 'tabler:device-floppy', 3000);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -63,12 +63,13 @@ export function M3SchemeBuilder({ scheme, onBuildCompleted }: M3SchemeBuilderPro
 | 
				
			|||||||
  const [, handleDraftAction] = useActionState<Map<string, string>, FormData>(
 | 
					  const [, handleDraftAction] = useActionState<Map<string, string>, FormData>(
 | 
				
			||||||
    (_state, formData) => {
 | 
					    (_state, formData) => {
 | 
				
			||||||
      const errMsg = new Map<string, string>();
 | 
					      const errMsg = new Map<string, string>();
 | 
				
			||||||
      const collectedSource = collectSchemeSource(formData);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      const collectedSource = collectSchemeSource(formData);
 | 
				
			||||||
      updateScheme((prev) => {
 | 
					      updateScheme((prev) => {
 | 
				
			||||||
        prev.schemeStorage.source = collectedSource;
 | 
					        prev.schemeStorage.source = collectedSource;
 | 
				
			||||||
        return prev;
 | 
					        return prev;
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					      setNewColors([]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      showToast(NotificationType.SUCCESS, 'Scheme draft saved!', 'tabler:device-floppy', 3000);
 | 
					      showToast(NotificationType.SUCCESS, 'Scheme draft saved!', 'tabler:device-floppy', 3000);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user