@@ -8,7 +8,6 @@ import {ToneIcon} from '../../../../../ui-components/toneIcon/ToneIcon'
8
8
import { Translate , useTranslation } from '../../../../i18n'
9
9
import { usePerspective } from '../../../../perspective/usePerspective'
10
10
import { useSetPerspective } from '../../../../perspective/useSetPerspective'
11
- import { supportsLocalStorage } from '../../../../util/supportsLocalStorage'
12
11
import { PublishedRelease } from '../../../__telemetry__/releases.telemetry'
13
12
import { releasesLocaleNamespace } from '../../../i18n'
14
13
import { isReleaseDocument , type ReleaseDocument } from '../../../index'
@@ -34,16 +33,10 @@ export const ReleasePublishAllButton = ({
34
33
const perspective = usePerspective ( )
35
34
const setPerspective = useSetPerspective ( )
36
35
const telemetry = useTelemetry ( )
37
- const publish2 = useMemo ( ( ) => {
38
- if ( supportsLocalStorage ) {
39
- return localStorage . getItem ( 'publish2' ) === 'true'
40
- }
41
- return false
42
- } , [ ] )
43
36
44
- const [ publishBundleStatus , setPublishBundleStatus ] = useState <
45
- 'idle' | 'confirm' | 'confirm-2' | 'publishing'
46
- > ( 'idle' )
37
+ const [ publishBundleStatus , setPublishBundleStatus ] = useState < 'idle' | 'confirm' | 'publishing' > (
38
+ 'idle' ,
39
+ )
47
40
48
41
const [ publishPermission , setPublishPermission ] = useState < boolean > ( false )
49
42
@@ -52,26 +45,19 @@ export const ReleasePublishAllButton = ({
52
45
53
46
const isPublishButtonDisabled =
54
47
disabled || isValidatingDocuments || hasDocumentValidationErrors || ! publishPermission
55
- const useUnstableAction = publishBundleStatus === 'confirm-2'
56
48
57
49
useEffect ( ( ) => {
58
- checkWithPermissionGuard ( publishRelease , release . _id , false ) . then ( ( hasPermission ) =>
50
+ checkWithPermissionGuard ( publishRelease , release . _id ) . then ( ( hasPermission ) =>
59
51
setPublishPermission ( hasPermission ) ,
60
52
)
61
- } , [
62
- checkWithPermissionGuard ,
63
- publishRelease ,
64
- release . _id ,
65
- release . metadata . intendedPublishAt ,
66
- useUnstableAction ,
67
- ] )
53
+ } , [ checkWithPermissionGuard , publishRelease , release . _id , release . metadata . intendedPublishAt ] )
68
54
69
55
const handleConfirmPublishAll = useCallback ( async ( ) => {
70
56
if ( ! release ) return
71
57
72
58
try {
73
59
setPublishBundleStatus ( 'publishing' )
74
- await publishRelease ( release . _id , useUnstableAction )
60
+ await publishRelease ( release . _id )
75
61
telemetry . log ( PublishedRelease )
76
62
toast . push ( {
77
63
closable : true ,
@@ -112,7 +98,6 @@ export const ReleasePublishAllButton = ({
112
98
} , [
113
99
release ,
114
100
publishRelease ,
115
- useUnstableAction ,
116
101
telemetry ,
117
102
toast ,
118
103
t ,
@@ -187,23 +172,6 @@ export const ReleasePublishAllButton = ({
187
172
188
173
return (
189
174
< >
190
- { publish2 && (
191
- < Button
192
- tooltipProps = { {
193
- disabled : ! isPublishButtonDisabled ,
194
- content : publishTooltipContent ,
195
- placement : 'bottom' ,
196
- } }
197
- icon = { PublishIcon }
198
- disabled = { isPublishButtonDisabled || publishBundleStatus === 'publishing' }
199
- // eslint-disable-next-line @sanity/i18n/no-attribute-string-literals
200
- text = { 'Unstable Publish' }
201
- onClick = { ( ) => setPublishBundleStatus ( 'confirm-2' ) }
202
- loading = { publishBundleStatus === 'publishing' }
203
- data-testid = "publish-all-button"
204
- tone = "suggest"
205
- />
206
- ) }
207
175
< Button
208
176
tooltipProps = { {
209
177
disabled : ! isPublishButtonDisabled ,
0 commit comments