mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-02 21:58:29 +00:00
wip propose back a no effect options to help user deactivate their effect
This commit is contained in:
+34
-1
@@ -25,7 +25,11 @@ import {
|
||||
} from '@/features/files/api/listFiles.ts'
|
||||
import { useCreateFile } from '@/features/files/api/createFile.ts'
|
||||
import { FileTrigger } from 'react-aria-components'
|
||||
import { RiDeleteBinLine, RiImageAddFill } from '@remixicon/react'
|
||||
import {
|
||||
RiDeleteBinLine,
|
||||
RiImageAddFill,
|
||||
RiProhibitedLine,
|
||||
} from '@remixicon/react'
|
||||
import { useDeleteFile } from '@/features/files/api/deleteFile.ts'
|
||||
import { useUser } from '@/features/auth/api/useUser'
|
||||
import { ApiFileItem } from '@/features/files/api/types.ts'
|
||||
@@ -250,6 +254,24 @@ export const EffectsConfiguration = ({
|
||||
[enabled, selectedId, toggle, updateEffectStatusMessage, videoTrack]
|
||||
)
|
||||
|
||||
const clearEffect = useCallback(async () => {
|
||||
if (selectedId === 'none') return
|
||||
setProcessorPending(true)
|
||||
try {
|
||||
if (videoTrack?.getProcessor()) {
|
||||
await videoTrack.stopProcessor()
|
||||
}
|
||||
saveProcessorConfig(undefined)
|
||||
announceEffectStatusMessage(t('blur.status.none'))
|
||||
} catch (error) {
|
||||
reportError('effects_processor_failure', error, {
|
||||
context: 'Error clearing effect:',
|
||||
})
|
||||
} finally {
|
||||
setTimeout(() => setProcessorPending(false))
|
||||
}
|
||||
}, [announceEffectStatusMessage, selectedId, t, videoTrack])
|
||||
|
||||
const { data: appConfig } = useConfig()
|
||||
const { isLoggedIn } = useUser()
|
||||
const canUploadBackground =
|
||||
@@ -647,6 +669,17 @@ export const EffectsConfiguration = ({
|
||||
gap: '1.25rem',
|
||||
})}
|
||||
>
|
||||
<ToggleButton
|
||||
variant="bigSquare"
|
||||
aria-label={t('clear')}
|
||||
tooltip={t('clear')}
|
||||
isDisabled={processorOptions.isDisabled}
|
||||
onChange={clearEffect}
|
||||
isSelected={selectedId === 'none'}
|
||||
data-attr="toggle-effect-none"
|
||||
>
|
||||
<RiProhibitedLine />
|
||||
</ToggleButton>
|
||||
{processorOptions.blurBased.map(({ Icon, ...option }) => (
|
||||
<ToggleButton
|
||||
key={option.id}
|
||||
|
||||
Reference in New Issue
Block a user