From c23d9c32aa74e68258310d40d7bb4f315bfef298 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Tue, 22 Jun 2021 10:47:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8F=92=E5=85=A5=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E5=90=8E=E6=9C=AA=E6=B8=85=E9=99=A4=E3=80=90=E5=87=86=E5=A4=87?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E3=80=91=E7=8A=B6=E6=80=81=EF=BC=88#39?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useCreateElement.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hooks/useCreateElement.ts b/src/hooks/useCreateElement.ts index 129ed9e3..c6060866 100644 --- a/src/hooks/useCreateElement.ts +++ b/src/hooks/useCreateElement.ts @@ -28,6 +28,7 @@ export default () => { const fontColor = computed(() => store.state.theme.fontColor) const fontName = computed(() => store.state.theme.fontName) const viewportRatio = computed(() => store.state.viewportRatio) + const creatingElement = computed(() => store.state.creatingElement) const { addHistorySnapshot } = useHistorySnapshot() @@ -35,6 +36,9 @@ export default () => { const createElement = (element: PPTElement) => { store.commit(MutationTypes.ADD_ELEMENT, element) store.commit(MutationTypes.SET_ACTIVE_ELEMENT_ID_LIST, [element.id]) + + if (creatingElement.value) store.commit(MutationTypes.SET_CREATING_ELEMENT, null) + addHistorySnapshot() }