Skip to content

Commit

Permalink
feat: remove notebook save button
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenHoangSon96 committed Feb 14, 2025
1 parent a82b770 commit 1f5f5b7
Showing 1 changed file with 2 additions and 30 deletions.
32 changes: 2 additions & 30 deletions src/flows/components/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
// Libraries
import React, {FC, useCallback, useContext, useEffect} from 'react'
import React, {FC, useContext} from 'react'

// Contexts
import {FlowContext} from 'src/flows/context/flow.current'
import {
VersionPublishContext,
VersionPublishProvider,
} from 'src/flows/context/version.publish'
import {VersionPublishProvider} from 'src/flows/context/version.publish'
import {AppSettingProvider} from 'src/shared/contexts/app'

// Components
Expand Down Expand Up @@ -35,25 +32,6 @@ import {DEFAULT_PROJECT_NAME} from 'src/flows'

const FlowHeader: FC = () => {
const {flow, updateOther} = useContext(FlowContext)
const {handlePublish} = useContext(VersionPublishContext)

const handleSave = useCallback(
event => {
if ((event.ctrlKey || event.metaKey) && event.key === 's') {
event.preventDefault()
handlePublish()
}
},
[handlePublish]
)

useEffect(() => {
window.addEventListener('keydown', handleSave)

return () => {
window.removeEventListener('keydown', handleSave)
}
}, [handleSave])

const handleRename = (name: string) => {
updateOther({name})
Expand Down Expand Up @@ -88,12 +66,6 @@ const FlowHeader: FC = () => {
<PresentationMode />
<TimeZoneDropdown />
<TimeRangeDropdown />
<SquareButton
icon={IconFont.Save}
onClick={handlePublish}
color={ComponentColor.Default}
titleText="Save to version history"
/>
{flow?.id && (
<>
<MenuButton />
Expand Down

0 comments on commit 1f5f5b7

Please sign in to comment.